From 9562ab4cbb3ea81d11a34241f6f58b79b8f35852 Mon Sep 17 00:00:00 2001 From: Doug Richar Date: Wed, 8 Jan 2025 11:37:01 -0500 Subject: [PATCH] refactor(*): remove Pera v2 beta wallet support Remove support for `@perawallet/connect-beta` package and `PERA2` wallet type. Users should migrate to the stable `@perawallet/connect@^1.4.0` package and `PERA` wallet provider. --- packages/use-wallet-react/package.json | 4 - packages/use-wallet-solid/package.json | 4 - packages/use-wallet-vue/package.json | 4 - packages/use-wallet/package.json | 5 - .../src/__tests__/wallets/pera2.test.ts | 612 ------------------ packages/use-wallet/src/utils.ts | 2 - packages/use-wallet/src/wallets/pera2.ts | 272 -------- packages/use-wallet/src/wallets/types.ts | 7 - packages/use-wallet/src/webpack.ts | 1 - pnpm-lock.yaml | 199 ------ 10 files changed, 1110 deletions(-) delete mode 100644 packages/use-wallet/src/__tests__/wallets/pera2.test.ts delete mode 100644 packages/use-wallet/src/wallets/pera2.ts diff --git a/packages/use-wallet-react/package.json b/packages/use-wallet-react/package.json index 70c797e5..48e6309c 100644 --- a/packages/use-wallet-react/package.json +++ b/packages/use-wallet-react/package.json @@ -53,7 +53,6 @@ "peerDependencies": { "@blockshake/defly-connect": "^1.2.0", "@magic-ext/algorand": "^23.18.0", - "@perawallet/connect-beta": "^2.0.21", "@walletconnect/modal": "^2.7.0", "@perawallet/connect": "^1.4.0", "@walletconnect/sign-client": "^2.17.2", @@ -73,9 +72,6 @@ "@perawallet/connect": { "optional": true }, - "@perawallet/connect-beta": { - "optional": true - }, "@walletconnect/modal": { "optional": true }, diff --git a/packages/use-wallet-solid/package.json b/packages/use-wallet-solid/package.json index d47cb6b8..dd31189e 100644 --- a/packages/use-wallet-solid/package.json +++ b/packages/use-wallet-solid/package.json @@ -76,7 +76,6 @@ "@blockshake/defly-connect": "^1.2.0", "@magic-ext/algorand": "^23.18.0", "@perawallet/connect": "^1.4.0", - "@perawallet/connect-beta": "^2.0.21", "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.2", "algosdk": "^3.0.0", @@ -93,9 +92,6 @@ "@perawallet/connect": { "optional": true }, - "@perawallet/connect-beta": { - "optional": true - }, "@walletconnect/modal": { "optional": true }, diff --git a/packages/use-wallet-vue/package.json b/packages/use-wallet-vue/package.json index cdefe38a..dba9a365 100644 --- a/packages/use-wallet-vue/package.json +++ b/packages/use-wallet-vue/package.json @@ -51,7 +51,6 @@ "@blockshake/defly-connect": "^1.2.0", "@magic-ext/algorand": "^23.18.0", "@perawallet/connect": "^1.4.0", - "@perawallet/connect-beta": "^2.0.21", "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.2", "algosdk": "^3.0.0", @@ -69,9 +68,6 @@ "@perawallet/connect": { "optional": true }, - "@perawallet/connect-beta": { - "optional": true - }, "@walletconnect/modal": { "optional": true }, diff --git a/packages/use-wallet/package.json b/packages/use-wallet/package.json index 7469efc6..02c95fc9 100644 --- a/packages/use-wallet/package.json +++ b/packages/use-wallet/package.json @@ -46,7 +46,6 @@ "@magic-ext/algorand": "23.18.0", "@magic-sdk/provider": "28.18.0", "@perawallet/connect": "1.4.0", - "@perawallet/connect-beta": "2.0.21", "@types/node": "20.11.30", "@walletconnect/modal": "2.7.0", "@walletconnect/modal-core": "2.7.0", @@ -63,7 +62,6 @@ "@algorandfoundation/liquid-auth-use-wallet-client": "1.1.0", "@blockshake/defly-connect": "^1.1.6", "@perawallet/connect": "^1.4.0", - "@perawallet/connect-beta": "^2.0.21", "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.2", "algosdk": "^3.0.0", @@ -82,9 +80,6 @@ "@perawallet/connect": { "optional": true }, - "@perawallet/connect-beta": { - "optional": true - }, "@walletconnect/modal": { "optional": true }, diff --git a/packages/use-wallet/src/__tests__/wallets/pera2.test.ts b/packages/use-wallet/src/__tests__/wallets/pera2.test.ts deleted file mode 100644 index 67a2a526..00000000 --- a/packages/use-wallet/src/__tests__/wallets/pera2.test.ts +++ /dev/null @@ -1,612 +0,0 @@ -import { Store } from '@tanstack/store' -import algosdk from 'algosdk' -import { logger } from 'src/logger' -import { DEFAULT_NETWORKS } from 'src/network' -import { StorageAdapter } from 'src/storage' -import { LOCAL_STORAGE_KEY, State, WalletState, DEFAULT_STATE } from 'src/store' -import { PeraWallet } from 'src/wallets/pera2' -import { WalletId } from 'src/wallets/types' -import type { Mock } from 'vitest' - -// Mock logger -vi.mock('src/logger', () => ({ - logger: { - createScopedLogger: vi.fn().mockReturnValue({ - debug: vi.fn(), - info: vi.fn(), - warn: vi.fn(), - error: vi.fn() - }) - } -})) - -// Mock storage adapter -vi.mock('src/storage', () => ({ - StorageAdapter: { - getItem: vi.fn(), - setItem: vi.fn(), - removeItem: vi.fn() - } -})) - -const mockPeraWallet = { - connect: vi.fn(), - reconnectSession: vi.fn(), - disconnect: vi.fn(), - signTransaction: vi.fn(), - client: { - on: vi.fn(), - off: vi.fn() - } -} - -vi.mock('@perawallet/connect-beta', () => { - return { - PeraWalletConnect: vi.fn(() => mockPeraWallet) - } -}) - -function createWalletWithStore(store: Store): PeraWallet { - const wallet = new PeraWallet({ - id: WalletId.PERA2, - options: { - projectId: 'mockProjectId' - }, - metadata: {}, - getAlgodClient: () => ({}) as any, - store, - subscribe: vi.fn(), - networks: DEFAULT_NETWORKS - }) - - // @ts-expect-error - Mocking the private client property - wallet.client = mockPeraWallet - - return wallet -} - -describe('PeraWallet', () => { - let wallet: PeraWallet - let store: Store - let mockInitialState: State | null = null - let mockLogger: { - debug: Mock - info: Mock - warn: Mock - error: Mock - } - - const account1 = { - name: 'Pera Account 1', - address: 'mockAddress1' - } - const account2 = { - name: 'Pera Account 2', - address: 'mockAddress2' - } - - beforeEach(() => { - vi.clearAllMocks() - - vi.mocked(StorageAdapter.getItem).mockImplementation((key: string) => { - if (key === LOCAL_STORAGE_KEY && mockInitialState !== null) { - return JSON.stringify(mockInitialState) - } - return null - }) - - vi.mocked(StorageAdapter.setItem).mockImplementation((key: string, value: string) => { - if (key === LOCAL_STORAGE_KEY) { - mockInitialState = JSON.parse(value) - } - }) - - mockLogger = { - debug: vi.fn(), - info: vi.fn(), - warn: vi.fn(), - error: vi.fn() - } - vi.mocked(logger.createScopedLogger).mockReturnValue(mockLogger) - - store = new Store(DEFAULT_STATE) - wallet = createWalletWithStore(store) - }) - - afterEach(async () => { - await wallet.disconnect() - mockInitialState = null - }) - - describe('connect', () => { - it('should initialize client, return accounts, and update store', async () => { - mockPeraWallet.connect.mockResolvedValueOnce([account1.address, account2.address]) - - const accounts = await wallet.connect() - - expect(wallet.isConnected).toBe(true) - expect(accounts).toEqual([account1, account2]) - expect(store.state.wallets[WalletId.PERA2]).toEqual({ - accounts: [account1, account2], - activeAccount: account1 - }) - }) - - it('should throw an error if connection fails', async () => { - mockPeraWallet.connect.mockRejectedValueOnce(new Error('Auth error')) - - await expect(wallet.connect()).rejects.toThrow('Auth error') - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - expect(wallet.isConnected).toBe(false) - }) - - it('should throw an error if an empty array is returned', async () => { - mockPeraWallet.connect.mockImplementation(() => Promise.resolve([])) - - await expect(wallet.connect()).rejects.toThrow('No accounts found!') - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - expect(wallet.isConnected).toBe(false) - }) - - it('should register session_delete event listener after successful connection', async () => { - mockPeraWallet.connect.mockResolvedValueOnce([account1.address, account2.address]) - - await wallet.connect() - - expect(mockPeraWallet.client.on).toHaveBeenCalledWith('session_delete', expect.any(Function)) - }) - }) - - describe('disconnect', () => { - it('should disconnect client and remove wallet from store', async () => { - mockPeraWallet.connect.mockResolvedValueOnce([account1.address]) - - await wallet.connect() - await wallet.disconnect() - - expect(mockPeraWallet.disconnect).toHaveBeenCalled() - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - expect(wallet.isConnected).toBe(false) - }) - - it('should throw an error if client.disconnect fails', async () => { - mockPeraWallet.connect.mockResolvedValueOnce([account1.address]) - mockPeraWallet.disconnect.mockRejectedValueOnce(new Error('Disconnect error')) - - await wallet.connect() - - await expect(wallet.disconnect()).rejects.toThrow('Disconnect error') - - // Should still update store/state - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - expect(wallet.isConnected).toBe(false) - }) - }) - - describe('session_delete event', () => { - it('should handle session_delete event and update store', async () => { - mockPeraWallet.connect.mockResolvedValueOnce([account1.address, account2.address]) - await wallet.connect() - - const sessionDeleteHandler = mockPeraWallet.client.on.mock.calls.find( - (call) => call[0] === 'session_delete' - )?.[1] as (() => void) | undefined - - expect(sessionDeleteHandler).toBeDefined() - - if (sessionDeleteHandler) { - sessionDeleteHandler() - } - - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - }) - }) - - describe('resumeSession', () => { - it('should do nothing if no session is found', async () => { - await wallet.resumeSession() - - expect(mockPeraWallet.reconnectSession).not.toHaveBeenCalled() - expect(wallet.isConnected).toBe(false) - }) - - it('should resume session if session is found', async () => { - const walletState: WalletState = { - accounts: [account1], - activeAccount: account1 - } - - store = new Store({ - ...DEFAULT_STATE, - wallets: { - [WalletId.PERA2]: walletState - } - }) - - wallet = createWalletWithStore(store) - - mockPeraWallet.reconnectSession.mockResolvedValueOnce([account1.address]) - - await wallet.resumeSession() - - expect(mockPeraWallet.reconnectSession).toHaveBeenCalled() - expect(store.state.wallets[WalletId.PERA2]).toEqual(walletState) - expect(wallet.isConnected).toBe(true) - }) - - it('should update the store if accounts do not match', async () => { - // Stored accounts are 'mockAddress1' and 'mockAddress2' - const prevWalletState: WalletState = { - accounts: [ - { - name: 'Pera Account 1', - address: 'mockAddress1' - }, - { - name: 'Pera Account 2', - address: 'mockAddress2' - } - ], - activeAccount: { - name: 'Pera Account 1', - address: 'mockAddress1' - } - } - - store = new Store({ - ...DEFAULT_STATE, - wallets: { - [WalletId.PERA2]: prevWalletState - } - }) - - wallet = createWalletWithStore(store) - - // Client only returns 'mockAddress2' on reconnect, 'mockAddress1' is missing - const newAccounts = ['mockAddress2'] - - const newWalletState: WalletState = { - accounts: [ - { - name: 'Pera Account 1', // auto-generated name - address: 'mockAddress2' - } - ], - activeAccount: { - name: 'Pera Account 1', - address: 'mockAddress2' - } - } - - mockPeraWallet.reconnectSession.mockResolvedValueOnce(newAccounts) - - await wallet.resumeSession() - - expect(mockLogger.warn).toHaveBeenCalledWith('Session accounts mismatch, updating accounts', { - prev: prevWalletState.accounts, - current: newWalletState.accounts - }) - expect(store.state.wallets[WalletId.PERA2]).toEqual(newWalletState) - }) - - it('should throw an error and disconnect if reconnectSession fails', async () => { - const walletState: WalletState = { - accounts: [account1], - activeAccount: account1 - } - - store = new Store({ - ...DEFAULT_STATE, - wallets: { - [WalletId.PERA2]: walletState - } - }) - - wallet = createWalletWithStore(store) - - mockPeraWallet.reconnectSession.mockRejectedValueOnce(new Error('Reconnect error')) - - await expect(wallet.resumeSession()).rejects.toThrow('Reconnect error') - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - expect(wallet.isConnected).toBe(false) - }) - - it('should throw an error and disconnect if no accounts are found', async () => { - const walletState: WalletState = { - accounts: [account1], - activeAccount: account1 - } - - store = new Store({ - ...DEFAULT_STATE, - wallets: { - [WalletId.PERA2]: walletState - } - }) - - wallet = createWalletWithStore(store) - - mockPeraWallet.reconnectSession.mockImplementation(() => Promise.resolve([])) - - await expect(wallet.resumeSession()).rejects.toThrow('No accounts found!') - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - expect(wallet.isConnected).toBe(false) - }) - - describe('auto-connect in Pera browser', () => { - let mockUserAgent: string - - beforeEach(() => { - mockUserAgent = '' - vi.clearAllMocks() - - vi.stubGlobal('window', { - navigator: { - get userAgent() { - return mockUserAgent - } - } - }) - }) - - afterEach(() => { - vi.unstubAllGlobals() - }) - - it('should attempt auto-connect in Pera browser when no session exists and no active wallet', async () => { - mockUserAgent = 'pera/1.0.0' - mockPeraWallet.connect.mockResolvedValueOnce([account1.address]) - - await wallet.resumeSession() - - expect(mockPeraWallet.connect).toHaveBeenCalled() - expect(store.state.wallets[WalletId.PERA2]).toBeDefined() - expect(mockLogger.info).toHaveBeenCalledWith('Auto-connect successful') - }) - - it('should not attempt auto-connect if another wallet is active', async () => { - mockUserAgent = 'pera/1.0.0' - - // Set up another active wallet - store.setState((state) => ({ - ...state, - activeWallet: WalletId.DEFLY, - wallets: { - [WalletId.DEFLY]: { - accounts: [account2], - activeAccount: account2 - } - } - })) - - await wallet.resumeSession() - - expect(mockPeraWallet.connect).not.toHaveBeenCalled() - expect(mockLogger.info).toHaveBeenCalledWith('No session to resume') - }) - - it('should not attempt auto-connect in other browsers', async () => { - mockUserAgent = 'chrome/1.0.0' - - await wallet.resumeSession() - - expect(mockPeraWallet.connect).not.toHaveBeenCalled() - expect(mockLogger.info).toHaveBeenCalledWith('No session to resume') - }) - - it('should handle auto-connect failure gracefully', async () => { - mockUserAgent = 'pera/1.0.0' - mockPeraWallet.connect.mockRejectedValueOnce(new Error('Connect failed')) - - await wallet.resumeSession() - - expect(mockPeraWallet.connect).toHaveBeenCalled() - expect(mockLogger.warn).toHaveBeenCalledWith('Auto-connect failed:', 'Connect failed') - expect(store.state.wallets[WalletId.PERA2]).toBeUndefined() - }) - }) - }) - - describe('signing transactions', () => { - // Connected accounts - const connectedAcct1 = '7ZUECA7HFLZTXENRV24SHLU4AVPUTMTTDUFUBNBD64C73F3UHRTHAIOF6Q' - const connectedAcct2 = 'GD64YIY3TWGDMCNPP553DZPPR6LDUSFQOIJVFDPPXWEG3FVOJCCDBBHU5A' - - // Not connected account - const notConnectedAcct = 'EW64GC6F24M7NDSC5R3ES4YUVE3ZXXNMARJHDCCCLIHZU6TBEOC7XRSBG4' - - const makePayTxn = ({ amount = 1000, sender = connectedAcct1, receiver = connectedAcct2 }) => { - return new algosdk.Transaction({ - type: algosdk.TransactionType.pay, - sender, - suggestedParams: { - fee: 0, - firstValid: 51, - lastValid: 61, - minFee: 1000, - genesisID: 'mainnet-v1.0' - }, - paymentParams: { receiver, amount } - }) - } - - // Transactions used in tests - const txn1 = makePayTxn({ amount: 1000 }) - const txn2 = makePayTxn({ amount: 2000 }) - const txn3 = makePayTxn({ amount: 3000 }) - const txn4 = makePayTxn({ amount: 4000 }) - - const sTxn = new Uint8Array([1, 2, 3, 4]) - - beforeEach(async () => { - // Mock two connected accounts - mockPeraWallet.connect.mockResolvedValueOnce([connectedAcct1, connectedAcct2]) - - await wallet.connect() - }) - - describe('signTransactions', () => { - it('should process and sign a single algosdk.Transaction', async () => { - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn]) - - await wallet.signTransactions([txn1]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([[{ txn: txn1 }]]) - }) - - it('should process and sign a single algosdk.Transaction group', async () => { - const [gtxn1, gtxn2, gtxn3] = algosdk.assignGroupID([txn1, txn2, txn3]) - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn, sTxn]) - - await wallet.signTransactions([gtxn1, gtxn2, gtxn3]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([ - [{ txn: gtxn1 }, { txn: gtxn2 }, { txn: gtxn3 }] - ]) - }) - - it('should process and sign multiple algosdk.Transaction groups', async () => { - const [g1txn1, g1txn2] = algosdk.assignGroupID([txn1, txn2]) - const [g2txn1, g2txn2] = algosdk.assignGroupID([txn3, txn4]) - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn, sTxn, sTxn, sTxn]) - - await wallet.signTransactions([ - [g1txn1, g1txn2], - [g2txn1, g2txn2] - ]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([ - [{ txn: g1txn1 }, { txn: g1txn2 }, { txn: g2txn1 }, { txn: g2txn2 }] - ]) - }) - - it('should process and sign a single encoded transaction', async () => { - const encodedTxn = txn1.toByte() - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn]) - - await wallet.signTransactions([encodedTxn]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([ - [{ txn: algosdk.decodeUnsignedTransaction(encodedTxn) }] - ]) - }) - - it('should process and sign a single encoded transaction group', async () => { - const txnGroup = algosdk.assignGroupID([txn1, txn2, txn3]) - const [gtxn1, gtxn2, gtxn3] = txnGroup.map((txn) => txn.toByte()) - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn, sTxn, sTxn]) - - await wallet.signTransactions([gtxn1, gtxn2, gtxn3]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([ - [ - { txn: algosdk.decodeUnsignedTransaction(gtxn1) }, - { txn: algosdk.decodeUnsignedTransaction(gtxn2) }, - { txn: algosdk.decodeUnsignedTransaction(gtxn3) } - ] - ]) - }) - - it('should process and sign multiple encoded transaction groups', async () => { - const txnGroup1 = algosdk.assignGroupID([txn1, txn2]) - const [g1txn1, g1txn2] = txnGroup1.map((txn) => txn.toByte()) - - const txnGroup2 = algosdk.assignGroupID([txn3, txn4]) - const [g2txn1, g2txn2] = txnGroup2.map((txn) => txn.toByte()) - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn, sTxn, sTxn, sTxn]) - - await wallet.signTransactions([ - [g1txn1, g1txn2], - [g2txn1, g2txn2] - ]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([ - [ - { txn: algosdk.decodeUnsignedTransaction(g1txn1) }, - { txn: algosdk.decodeUnsignedTransaction(g1txn2) }, - { txn: algosdk.decodeUnsignedTransaction(g2txn1) }, - { txn: algosdk.decodeUnsignedTransaction(g2txn2) } - ] - ]) - }) - - it('should determine which transactions to sign based on indexesToSign', async () => { - const [gtxn1, gtxn2, gtxn3, gtxn4] = algosdk.assignGroupID([txn1, txn2, txn3, txn4]) - - const txnGroup = [gtxn1, gtxn2, gtxn3, gtxn4] - const indexesToSign = [0, 1, 3] - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn, sTxn, sTxn]) - - await expect(wallet.signTransactions(txnGroup, indexesToSign)).resolves.toEqual([ - sTxn, - sTxn, - null, - sTxn - ]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([ - [{ txn: gtxn1 }, { txn: gtxn2 }, { txn: gtxn3, signers: [] }, { txn: gtxn4 }] - ]) - }) - - it('should only send transactions with connected signers for signature', async () => { - const canSignTxn1 = makePayTxn({ sender: connectedAcct1, amount: 1000 }) - const cannotSignTxn2 = makePayTxn({ sender: notConnectedAcct, amount: 2000 }) - const canSignTxn3 = makePayTxn({ sender: connectedAcct2, amount: 3000 }) - - // Signer for gtxn2 is not a connected account - const [gtxn1, gtxn2, gtxn3] = algosdk.assignGroupID([ - canSignTxn1, - cannotSignTxn2, // Should not be signed - canSignTxn3 - ]) - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn, sTxn]) - - await expect(wallet.signTransactions([gtxn1, gtxn2, gtxn3])).resolves.toEqual([ - sTxn, - null, - sTxn - ]) - - expect(mockPeraWallet.signTransaction).toHaveBeenCalledWith([ - [{ txn: gtxn1 }, { txn: gtxn2, signers: [] }, { txn: gtxn3 }] - ]) - }) - - it('should insert null values in response for transactions that were not signed', async () => { - const txnGroup = algosdk.assignGroupID([txn1, txn2, txn3]) - const indexesToSign = [0, 2] - - mockPeraWallet.signTransaction.mockResolvedValueOnce([sTxn, sTxn]) - - await expect(wallet.signTransactions(txnGroup, indexesToSign)).resolves.toEqual([ - sTxn, - null, - sTxn - ]) - }) - }) - - describe('transactionSigner', () => { - it('should call signTransactions with the correct arguments', async () => { - const txnGroup = algosdk.assignGroupID([txn1, txn2]) - const indexesToSign = [1] - - const signTransactionsSpy = vi - .spyOn(wallet, 'signTransactions') - .mockImplementationOnce(() => Promise.resolve([sTxn])) - - await wallet.transactionSigner(txnGroup, indexesToSign) - - expect(signTransactionsSpy).toHaveBeenCalledWith(txnGroup, indexesToSign) - }) - }) - }) -}) diff --git a/packages/use-wallet/src/utils.ts b/packages/use-wallet/src/utils.ts index 3b20aa33..6ad66d70 100644 --- a/packages/use-wallet/src/utils.ts +++ b/packages/use-wallet/src/utils.ts @@ -12,7 +12,6 @@ import { LuteWallet } from './wallets/lute' import { MagicAuth } from './wallets/magic' import { MnemonicWallet } from './wallets/mnemonic' import { PeraWallet } from './wallets/pera' -import { PeraWallet as PeraWalletBeta } from './wallets/pera2' import { WalletConnect } from './wallets/walletconnect' export function createWalletMap(): WalletMap { @@ -29,7 +28,6 @@ export function createWalletMap(): WalletMap { [WalletId.MAGIC]: MagicAuth, [WalletId.MNEMONIC]: MnemonicWallet, [WalletId.PERA]: PeraWallet, - [WalletId.PERA2]: PeraWalletBeta, [WalletId.WALLETCONNECT]: WalletConnect } } diff --git a/packages/use-wallet/src/wallets/pera2.ts b/packages/use-wallet/src/wallets/pera2.ts deleted file mode 100644 index 9e7a94d3..00000000 --- a/packages/use-wallet/src/wallets/pera2.ts +++ /dev/null @@ -1,272 +0,0 @@ -import algosdk from 'algosdk' -import { WalletState, addWallet, setAccounts, type State } from 'src/store' -import { compareAccounts, flattenTxnGroup, isSignedTxn, isTransactionArray } from 'src/utils' -import { BaseWallet } from 'src/wallets/base' -import type { PeraWalletConnect } from '@perawallet/connect-beta' -import type { Store } from '@tanstack/store' -import type { - SignerTransaction, - WalletAccount, - WalletConstructor, - WalletId -} from 'src/wallets/types' - -export interface PeraWalletConnectOptions { - projectId: string - bridge?: string - shouldShowSignTxnToast?: boolean - chainId?: 416001 | 416002 | 416003 | 4160 - compactMode?: boolean -} - -const ICON = `data:image/svg+xml;base64,${btoa(` - - - - - - - - - -`)}` - -export class PeraWallet extends BaseWallet { - private client: PeraWalletConnect | null = null - private options: PeraWalletConnectOptions - - protected store: Store - - constructor({ - id, - store, - subscribe, - getAlgodClient, - options, - metadata = {}, - networks - }: WalletConstructor) { - super({ id, metadata, getAlgodClient, store, subscribe, networks }) - if (!options?.projectId) { - this.logger.error('Missing required option: projectId') - throw new Error('Missing required option: projectId') - } - this.options = options - this.store = store - } - - static defaultMetadata = { - name: 'Pera', - icon: ICON - } - - private async initializeClient(): Promise { - this.logger.info('Initializing client...') - const module = await import('@perawallet/connect-beta') - - const PeraWalletConnect = module.PeraWalletConnect || module.default.PeraWalletConnect - - const client = new PeraWalletConnect(this.options) - this.client = client - this.logger.info('Client initialized') - return client - } - - public connect = async (): Promise => { - this.logger.info('Connecting...') - const client = this.client || (await this.initializeClient()) - const accounts = await client.connect() - - // Listen for session_delete event - client.client?.on('session_delete', this.onDisconnect) - - if (accounts.length === 0) { - this.logger.error('No accounts found!') - throw new Error('No accounts found!') - } - - const walletAccounts = accounts.map((address: string, idx: number) => ({ - name: `${this.metadata.name} Account ${idx + 1}`, - address - })) - - const activeAccount = walletAccounts[0] - - const walletState: WalletState = { - accounts: walletAccounts, - activeAccount - } - - addWallet(this.store, { - walletId: this.id, - wallet: walletState - }) - - this.logger.info('Connected successfully', walletState) - return walletAccounts - } - - public disconnect = async (): Promise => { - this.logger.info('Disconnecting...') - this.onDisconnect() - const client = this.client || (await this.initializeClient()) - await client.disconnect() - this.logger.info('Disconnected') - } - - public resumeSession = async (): Promise => { - try { - const state = this.store.state - const walletState = state.wallets[this.id] - - // Check for Pera Discover browser and auto-connect if no other wallet is active - if (typeof window !== 'undefined' && window.navigator) { - const isPeraDiscover = window.navigator.userAgent.includes('pera') - if (isPeraDiscover && !walletState && !state.activeWallet) { - this.logger.info('Pera Discover browser detected, attempting auto-connect...') - try { - await this.connect() - this.logger.info('Auto-connect successful') - return - } catch (error: any) { - this.logger.warn('Auto-connect failed:', error.message) - } - } - } - - // No session to resume - if (!walletState) { - this.logger.info('No session to resume') - return - } - - this.logger.info('Resuming session...') - - const client = this.client || (await this.initializeClient()) - const accounts = await client.reconnectSession() - - if (accounts.length === 0) { - this.logger.error('No accounts found!') - throw new Error('No accounts found!') - } - - const walletAccounts = accounts.map((address: string, idx: number) => ({ - name: `${this.metadata.name} Account ${idx + 1}`, - address - })) - - const match = compareAccounts(walletAccounts, walletState.accounts) - - if (!match) { - this.logger.warn('Session accounts mismatch, updating accounts', { - prev: walletState.accounts, - current: walletAccounts - }) - setAccounts(this.store, { - walletId: this.id, - accounts: walletAccounts - }) - } - this.logger.info('Session resumed successfully') - } catch (error: any) { - this.logger.error('Error resuming session:', error.message) - this.onDisconnect() - throw error - } - } - - private processTxns( - txnGroup: algosdk.Transaction[], - indexesToSign?: number[] - ): SignerTransaction[] { - const txnsToSign: SignerTransaction[] = [] - - txnGroup.forEach((txn, index) => { - const isIndexMatch = !indexesToSign || indexesToSign.includes(index) - const signer = txn.sender.toString() - const canSignTxn = this.addresses.includes(signer) - - if (isIndexMatch && canSignTxn) { - txnsToSign.push({ txn }) - } else { - txnsToSign.push({ txn, signers: [] }) - } - }) - - return txnsToSign - } - - private processEncodedTxns( - txnGroup: Uint8Array[], - indexesToSign?: number[] - ): SignerTransaction[] { - const txnsToSign: SignerTransaction[] = [] - - txnGroup.forEach((txnBuffer, index) => { - const decodedObj = algosdk.msgpackRawDecode(txnBuffer) - const isSigned = isSignedTxn(decodedObj) - - const txn: algosdk.Transaction = isSigned - ? algosdk.decodeSignedTransaction(txnBuffer).txn - : algosdk.decodeUnsignedTransaction(txnBuffer) - - const isIndexMatch = !indexesToSign || indexesToSign.includes(index) - const signer = txn.sender.toString() - const canSignTxn = !isSigned && this.addresses.includes(signer) - - if (isIndexMatch && canSignTxn) { - txnsToSign.push({ txn }) - } else { - txnsToSign.push({ txn, signers: [] }) - } - }) - - return txnsToSign - } - - public signTransactions = async ( - txnGroup: T | T[], - indexesToSign?: number[] - ): Promise<(Uint8Array | null)[]> => { - try { - this.logger.debug('Signing transactions...', { txnGroup, indexesToSign }) - let txnsToSign: SignerTransaction[] = [] - - // Determine type and process transactions for signing - if (isTransactionArray(txnGroup)) { - const flatTxns: algosdk.Transaction[] = flattenTxnGroup(txnGroup) - txnsToSign = this.processTxns(flatTxns, indexesToSign) - } else { - const flatTxns: Uint8Array[] = flattenTxnGroup(txnGroup as Uint8Array[]) - txnsToSign = this.processEncodedTxns(flatTxns, indexesToSign) - } - - const client = this.client || (await this.initializeClient()) - - this.logger.debug('Sending processed transactions to wallet...', [txnsToSign]) - - // Sign transactions - const signedTxns = await client.signTransaction([txnsToSign]) - this.logger.debug('Received signed transactions from wallet', signedTxns) - - // ARC-0001 - Return null for unsigned transactions - const result = txnsToSign.reduce<(Uint8Array | null)[]>((acc, txn) => { - if (txn.signers && txn.signers.length == 0) { - acc.push(null) - } else { - const signedTxn = signedTxns.shift() - if (signedTxn) { - acc.push(signedTxn) - } - } - return acc - }, []) - - this.logger.debug('Transactions signed successfully', result) - return result - } catch (error: any) { - this.logger.error('Error signing transactions:', error.message) - throw error - } - } -} diff --git a/packages/use-wallet/src/wallets/types.ts b/packages/use-wallet/src/wallets/types.ts index 52fff391..d2851aff 100644 --- a/packages/use-wallet/src/wallets/types.ts +++ b/packages/use-wallet/src/wallets/types.ts @@ -9,10 +9,6 @@ import { LuteConnectOptions, LuteWallet } from './lute' import { MagicAuth, MagicAuthOptions } from './magic' import { MnemonicWallet, type MnemonicOptions } from './mnemonic' import { PeraWallet, type PeraWalletConnectOptions } from './pera' -import { - PeraWallet as PeraWalletBeta, - type PeraWalletConnectOptions as PeraWalletConnectBetaOptions -} from './pera2' import { WalletConnect, type WalletConnectOptions } from './walletconnect' import { BiatecWallet } from './biatec' import type { Store } from '@tanstack/store' @@ -33,7 +29,6 @@ export enum WalletId { MAGIC = 'magic', MNEMONIC = 'mnemonic', PERA = 'pera', - PERA2 = 'pera-beta', WALLETCONNECT = 'walletconnect' } @@ -50,7 +45,6 @@ export type WalletMap = { [WalletId.MAGIC]: typeof MagicAuth [WalletId.MNEMONIC]: typeof MnemonicWallet [WalletId.PERA]: typeof PeraWallet - [WalletId.PERA2]: typeof PeraWalletBeta [WalletId.WALLETCONNECT]: typeof WalletConnect } @@ -67,7 +61,6 @@ export type WalletOptionsMap = { [WalletId.MAGIC]: MagicAuthOptions [WalletId.MNEMONIC]: MnemonicOptions [WalletId.PERA]: PeraWalletConnectOptions - [WalletId.PERA2]: PeraWalletConnectBetaOptions [WalletId.WALLETCONNECT]: WalletConnectOptions } diff --git a/packages/use-wallet/src/webpack.ts b/packages/use-wallet/src/webpack.ts index 453951f0..825ad6f8 100644 --- a/packages/use-wallet/src/webpack.ts +++ b/packages/use-wallet/src/webpack.ts @@ -11,7 +11,6 @@ export const webpackFallback = { '@blockshake/defly-connect': false, '@magic-ext/algorand': false, '@perawallet/connect': false, - '@perawallet/connect-beta': false, '@walletconnect/modal': false, '@walletconnect/sign-client': false, 'lute-connect': false, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a525772a..71185844 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -363,9 +363,6 @@ importers: '@perawallet/connect': specifier: 1.4.0 version: 1.4.0(algosdk@3.0.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@perawallet/connect-beta': - specifier: 2.0.21 - version: 2.0.21(algosdk@3.0.0)(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10) '@types/node': specifier: 20.11.30 version: 20.11.30 @@ -408,9 +405,6 @@ importers: '@perawallet/connect': specifier: ^1.4.0 version: 1.4.0(algosdk@3.0.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@perawallet/connect-beta': - specifier: ^2.0.21 - version: 2.0.21(algosdk@3.0.0)(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10) '@tanstack/react-store': specifier: 0.6.1 version: 0.6.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -463,9 +457,6 @@ importers: '@perawallet/connect': specifier: ^1.4.0 version: 1.4.0(algosdk@3.0.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@perawallet/connect-beta': - specifier: ^2.0.21 - version: 2.0.21(algosdk@3.0.0)(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10) '@tanstack/solid-store': specifier: 0.6.0 version: 0.6.0(solid-js@1.9.3) @@ -515,9 +506,6 @@ importers: '@perawallet/connect': specifier: ^1.4.0 version: 1.4.0(algosdk@3.0.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@perawallet/connect-beta': - specifier: ^2.0.21 - version: 2.0.21(algosdk@3.0.0)(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10) '@tanstack/vue-store': specifier: 0.6.0 version: 0.6.0(vue@3.5.13(typescript@5.6.3)) @@ -1309,14 +1297,6 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@json-rpc-tools/types@1.7.6': - resolution: {integrity: sha512-nDSqmyRNEqEK9TZHtM15uNnDljczhCUdBmRhpNZ95bIPKEDQ+nTDmGMFd2lLin3upc5h2VVVd9tkTDdbXUhDIQ==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - - '@json-rpc-tools/utils@1.7.6': - resolution: {integrity: sha512-HjA8x/U/Q78HRRe19yh8HVKoZ+Iaoo3YZjakJYxR+rw52NHo6jM+VE9b8+7ygkCFXl/EHID5wh/MkXaE/jGyYw==} - deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. - '@kwsites/file-exists@1.1.1': resolution: {integrity: sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==} @@ -1591,14 +1571,6 @@ packages: resolution: {integrity: sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==} engines: {node: '>= 10.0.0'} - '@pedrouid/environment@1.0.1': - resolution: {integrity: sha512-HaW78NszGzRZd9SeoI3JD11JqY+lubnaOx7Pewj5pfjqWXOEATpeKIFb9Z4t2WBUK2iryiXX3lzWwmYWgUL0Ug==} - - '@perawallet/connect-beta@2.0.21': - resolution: {integrity: sha512-EneNpW8U6Av81HMcgP9hbnQWOksCleJ0KVCBAGRYLsgqSNFrxxGQLP2Vd/Vp0ZLQvDr+7s6TX0COy+TOCTv2KA==} - peerDependencies: - algosdk: ^2.8.0 - '@perawallet/connect@1.4.0': resolution: {integrity: sha512-ef6sQQWhCJ/fMe6VKOaSIaP4hpc2XufKJlv5A+kSHSoUD3NG0Me6R9oyDlxM7UcW/vTyWdg3lDEsPS92v+wBUA==} peerDependencies: @@ -2324,10 +2296,6 @@ packages: '@walletconnect/core@1.8.0': resolution: {integrity: sha512-aFTHvEEbXcZ8XdWBw6rpQDte41Rxwnuk3SgTD8/iKGSRTni50gI9S3YEzMj05jozSiOBxQci4pJDMVhIUMtarw==} - '@walletconnect/core@2.17.0': - resolution: {integrity: sha512-On+uSaCfWdsMIQsECwWHZBmUXfrnqmv6B8SXRRuTJgd8tUpEvBkLQH4X7XkSm3zW6ozEkQTCagZ2ox2YPn3kbw==} - engines: {node: '>=18'} - '@walletconnect/core@2.17.2': resolution: {integrity: sha512-O9VUsFg78CbvIaxfQuZMsHcJ4a2Z16DRz/O4S+uOAcGKhH/i/ln8hp864Tb+xRvifWSzaZ6CeAVxk657F+pscA==} engines: {node: '>=18'} @@ -2397,9 +2365,6 @@ packages: '@walletconnect/safe-json@1.0.2': resolution: {integrity: sha512-Ogb7I27kZ3LPC3ibn8ldyUr5544t3/STow9+lzz7Sfo808YD7SBWk7SAsdBFlYgP2zDRy2hS3sKRcuSRM0OTmA==} - '@walletconnect/sign-client@2.17.0': - resolution: {integrity: sha512-sErYwvSSHQolNXni47L3Bm10ptJc1s1YoJvJd34s5E9h9+d3rj7PrhbiW9X82deN+Dm5oA8X9tC4xty1yIBrVg==} - '@walletconnect/sign-client@2.17.2': resolution: {integrity: sha512-/wigdCIQjlBXSWY43Id0IPvZ5biq4HiiQZti8Ljvx408UYjmqcxcBitbj2UJXMYkid7704JWAB2mw32I1HgshQ==} @@ -2413,18 +2378,12 @@ packages: resolution: {integrity: sha512-Cn+3I0V0vT9ghMuzh1KzZvCkiAxTq+1TR2eSqw5E5AVWfmCtECFkVZBP6uUJZ8YjwLqXheI+rnjqPy7sVM4Fyg==} deprecated: 'WalletConnect''s v1 SDKs are now deprecated. Please upgrade to a v2 SDK. For details see: https://docs.walletconnect.com/' - '@walletconnect/types@2.17.0': - resolution: {integrity: sha512-i1pn9URpvt9bcjRDkabuAmpA9K7mzyKoLJlbsAujRVX7pfaG7wur7u9Jz0bk1HxvuABL5LHNncTnVKSXKQ5jZA==} - '@walletconnect/types@2.17.2': resolution: {integrity: sha512-j/+0WuO00lR8ntu7b1+MKe/r59hNwYLFzW0tTmozzhfAlDL+dYwWasDBNq4AH8NbVd7vlPCQWmncH7/6FVtOfQ==} '@walletconnect/utils@1.8.0': resolution: {integrity: sha512-zExzp8Mj1YiAIBfKNm5u622oNw44WOESzo6hj+Q3apSMIb0Jph9X3GDIdbZmvVZsNPxWDL7uodKgZcCInZv2vA==} - '@walletconnect/utils@2.17.0': - resolution: {integrity: sha512-1aeQvjwsXy4Yh9G6g2eGmXrEl+BzkNjHRdCrGdMYqFTFa8ROEJfTGsSH3pLsNDlOY94CoBUvJvM55q/PMoN/FQ==} - '@walletconnect/utils@2.17.2': resolution: {integrity: sha512-T7eLRiuw96fgwUy2A5NZB5Eu87ukX8RCVoO9lji34RFV4o2IGU9FhTEWyd4QQKI8OuQRjSknhbJs0tU0r0faPw==} @@ -7543,15 +7502,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@json-rpc-tools/types@1.7.6': - dependencies: - keyvaluestorage-interface: 1.0.0 - - '@json-rpc-tools/utils@1.7.6': - dependencies: - '@json-rpc-tools/types': 1.7.6 - '@pedrouid/environment': 1.0.1 - '@kwsites/file-exists@1.1.1': dependencies: debug: 4.3.7(supports-color@9.4.0) @@ -7975,36 +7925,6 @@ snapshots: '@parcel/watcher-win32-ia32': 2.4.1 '@parcel/watcher-win32-x64': 2.4.1 - '@pedrouid/environment@1.0.1': {} - - '@perawallet/connect-beta@2.0.21(algosdk@3.0.0)(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10)': - dependencies: - '@evanhahn/lottie-web-light': 5.8.1 - '@json-rpc-tools/utils': 1.7.6 - '@walletconnect/sign-client': 2.17.0(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10) - '@walletconnect/types': 2.17.0(ioredis@5.4.1) - '@walletconnect/utils': 2.17.0(ioredis@5.4.1) - algosdk: 3.0.0 - bowser: 2.11.0 - buffer: 6.0.3 - qr-code-styling: 1.6.0-rc.1 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - ioredis - - utf-8-validate - '@perawallet/connect@1.4.0(algosdk@3.0.0)(bufferutil@4.0.8)(utf-8-validate@5.0.10)': dependencies: '@evanhahn/lottie-web-light': 5.8.1 @@ -8910,41 +8830,6 @@ snapshots: - bufferutil - utf-8-validate - '@walletconnect/core@2.17.0(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10)': - dependencies: - '@walletconnect/heartbeat': 1.2.2 - '@walletconnect/jsonrpc-provider': 1.0.14 - '@walletconnect/jsonrpc-types': 1.0.4 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/jsonrpc-ws-connection': 1.0.14(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.1) - '@walletconnect/logger': 2.1.2 - '@walletconnect/relay-api': 1.0.11 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.0(ioredis@5.4.1) - '@walletconnect/utils': 2.17.0(ioredis@5.4.1) - events: 3.3.0 - lodash.isequal: 4.5.0 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - ioredis - - utf-8-validate - '@walletconnect/core@2.17.2(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/heartbeat': 1.2.2 @@ -9119,34 +9004,6 @@ snapshots: dependencies: tslib: 1.14.1 - '@walletconnect/sign-client@2.17.0(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10)': - dependencies: - '@walletconnect/core': 2.17.0(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10) - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.2 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/logger': 2.1.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.0(ioredis@5.4.1) - '@walletconnect/utils': 2.17.0(ioredis@5.4.1) - events: 3.3.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - bufferutil - - ioredis - - utf-8-validate - '@walletconnect/sign-client@2.17.2(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10)': dependencies: '@walletconnect/core': 2.17.2(bufferutil@4.0.8)(ioredis@5.4.1)(utf-8-validate@5.0.10) @@ -9190,29 +9047,6 @@ snapshots: '@walletconnect/types@1.8.0': {} - '@walletconnect/types@2.17.0(ioredis@5.4.1)': - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.2 - '@walletconnect/jsonrpc-types': 1.0.4 - '@walletconnect/keyvaluestorage': 1.1.1(ioredis@5.4.1) - '@walletconnect/logger': 2.1.2 - events: 3.3.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - ioredis - '@walletconnect/types@2.17.2(ioredis@5.4.1)': dependencies: '@walletconnect/events': 1.0.1 @@ -9246,39 +9080,6 @@ snapshots: js-sha3: 0.8.0 query-string: 6.13.5 - '@walletconnect/utils@2.17.0(ioredis@5.4.1)': - dependencies: - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/relay-api': 1.0.11 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.17.0(ioredis@5.4.1) - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - elliptic: 6.5.7 - query-string: 7.1.3 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@azure/app-configuration' - - '@azure/cosmos' - - '@azure/data-tables' - - '@azure/identity' - - '@azure/keyvault-secrets' - - '@azure/storage-blob' - - '@capacitor/preferences' - - '@netlify/blobs' - - '@planetscale/database' - - '@react-native-async-storage/async-storage' - - '@upstash/redis' - - '@vercel/kv' - - ioredis - '@walletconnect/utils@2.17.2(ioredis@5.4.1)': dependencies: '@ethersproject/hash': 5.7.0