Skip to content

Commit f56f5c0

Browse files
Merge pull request #1502 from input-output-hk/feat/lw-11630-dummy-on-off-experimental-features
feat(dapp-connector): add dummy on/off methods to Cip30Wallet
2 parents 1b54c26 + e337ea6 commit f56f5c0

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)