diff --git a/apps/dapp/pages/index.tsx b/apps/dapp/pages/index.tsx index 6ec72a2..7083083 100644 --- a/apps/dapp/pages/index.tsx +++ b/apps/dapp/pages/index.tsx @@ -86,7 +86,7 @@ export default function Index() { console.info('[APP] fetching address'); await timeoutPromise( enabledApi - .getUnusedAddresses() + .getUtxos() .then(addr => { console.info('[APP] addr', addr); return addr; diff --git a/packages/wc-dapp/src/provider/cardanoWcProvider.ts b/packages/wc-dapp/src/provider/cardanoWcProvider.ts index 81c8e14..f87a92a 100644 --- a/packages/wc-dapp/src/provider/cardanoWcProvider.ts +++ b/packages/wc-dapp/src/provider/cardanoWcProvider.ts @@ -70,11 +70,6 @@ export class CardanoWcProvider { async enable(sam?: boolean) { const session = this.provider?.session; // Edge Case: sometimes pairing is lost, so we disconnect session and reconnect - const pairingTopic = session?.pairingTopic; - const hasPairing = this.getSessionPair(pairingTopic); - if (!hasPairing && session) { - await this.disconnect(); - } if (!session) { await this.connect({ sam }); } else { diff --git a/packages/wc-dapp/src/provider/enabledWalletEmulator.ts b/packages/wc-dapp/src/provider/enabledWalletEmulator.ts index a91e571..4cddecd 100644 --- a/packages/wc-dapp/src/provider/enabledWalletEmulator.ts +++ b/packages/wc-dapp/src/provider/enabledWalletEmulator.ts @@ -3,7 +3,13 @@ import UniversalProvider from '@walletconnect/universal-provider'; import EventEmitter from 'events'; import { TRpc } from '../types'; -import type { Cbor, DataSignature, EnabledAPI, EnabledWalletEmulatorParams } from '../types/cip30'; +import type { + Cbor, + DataSignature, + EnabledAPI, + EnabledWalletEmulatorParams, + Paginate +} from '../types/cip30'; import { CARDANO_RPC_METHODS, CARDANO_SIGNING_METHODS, @@ -67,11 +73,12 @@ export class EnabledWalletEmulator implements EnabledAPI { return Promise.resolve(this._networkId as number); } - async getUtxos() { + async getUtxos(amount?: Cbor<'Value'>, paginate?: Paginate) { if (!this._sam) { return this._provider.request[]>( { - method: CARDANO_RPC_METHODS.CARDANO_GET_UTXOS + method: CARDANO_RPC_METHODS.CARDANO_GET_UTXOS, + params: [amount, paginate] }, this._chain );