Skip to content

Commit

Permalink
Merge pull request #1502 from input-output-hk/feat/lw-11630-dummy-on-…
Browse files Browse the repository at this point in the history
…off-experimental-features

feat(dapp-connector): add dummy on/off methods to Cip30Wallet
  • Loading branch information
AngelCastilloB authored Oct 6, 2024
2 parents 1b54c26 + e337ea6 commit f56f5c0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/dapp-connector/src/WalletApi/Cip30Wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ export type WalletProperties = {
* This is the way the Nami wallet works and some DApps rely on it (i.e. https://app.indigoprotocol.io/)
*/
getCollateralEmptyArray?: boolean;
/**
* Add the `on` and `off` methods to the experimental object.
* The methods do not have an implementation, but are used to satisfy
* some DApps that expect them to be present.
*/
onOffDummyMethods?: boolean;
};
};

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

0 comments on commit f56f5c0

Please sign in to comment.