Skip to content

Commit e337ea6

Browse files
committed
feat(dapp-connector): add dummy on/off methods to Cip30Wallet
1 parent 1b54c26 commit e337ea6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/dapp-connector/src/WalletApi/Cip30Wallet.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ export type WalletProperties = {
5656
* This is the way the Nami wallet works and some DApps rely on it (i.e. https://app.indigoprotocol.io/)
5757
*/
5858
getCollateralEmptyArray?: boolean;
59+
/**
60+
* Add the `on` and `off` methods to the experimental object.
61+
* The methods do not have an implementation, but are used to satisfy
62+
* some DApps that expect them to be present.
63+
*/
64+
onOffDummyMethods?: boolean;
5965
};
6066
};
6167

@@ -164,7 +170,8 @@ export class Cip30Wallet {
164170
const baseApi: Cip30WalletApiWithPossibleExtensions = {
165171
// Add experimental.getCollateral to CIP-30 API
166172
experimental: {
167-
getCollateral: async (params?: { amount?: Cbor }) => this.#wrapGetCollateral(params)
173+
getCollateral: async (params?: { amount?: Cbor }) => this.#wrapGetCollateral(params),
174+
...(this.#deviations?.onOffDummyMethods && { off: () => void 0, on: () => void 0 })
168175
},
169176
getBalance: () => walletApi.getBalance(),
170177
getChangeAddress: () => walletApi.getChangeAddress(),

0 commit comments

Comments
 (0)