Skip to content

Commit 577fa0c

Browse files
committed
Merge branch 'main' into lute-connect-update
2 parents c5d8ab6 + 2aa4165 commit 577fa0c

File tree

18 files changed

+1351
-2412
lines changed

18 files changed

+1351
-2412
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- uses: pnpm/action-setup@v4
2626
name: Install pnpm
2727
with:
28-
version: 9.15.4
28+
version: 9.15.9
2929
run_install: false
3030

3131
- name: Get pnpm store directory

examples/nextjs/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@
1414
"@txnlab/use-wallet-react": "workspace:*",
1515
"@walletconnect/modal": "^2.7.0",
1616
"@walletconnect/sign-client": "^2.17.3",
17-
"algosdk": "3.0.0",
17+
"algosdk": "3.2.0",
1818
"lute-connect": "^1.5.1",
19-
"next": "14.2.22",
19+
"next": "14.2.26",
2020
"react": "18.3.1",
2121
"react-dom": "18.3.1"
2222
},
2323
"devDependencies": {
2424
"@types/node": "20.11.30",
25-
"@types/react": "18.3.18",
25+
"@types/react": "18.3.20",
2626
"@types/react-dom": "18.3.5",
2727
"eslint": "8.57.1",
28-
"eslint-config-next": "14.2.22",
29-
"typescript": "5.7.2"
28+
"eslint-config-next": "14.2.26",
29+
"typescript": "5.8.2"
3030
}
3131
}

examples/nextjs/src/app/globals.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
:root {
22
--max-width: 1100px;
33
--border-radius: 12px;
4-
--font-mono: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono',
5-
'Oxygen Mono', 'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono',
6-
'Courier New', monospace;
4+
--font-mono:
5+
ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono',
6+
'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
77

88
--foreground-rgb: 0, 0, 0;
99
--background-start-rgb: 214, 219, 220;

examples/nuxt/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
"@txnlab/use-wallet-vue": "workspace:*",
1919
"@walletconnect/modal": "^2.7.0",
2020
"@walletconnect/sign-client": "^2.17.3",
21-
"algosdk": "3.0.0",
21+
"algosdk": "3.2.0",
2222
"lute-connect": "^1.5.1",
23-
"nuxt": "3.15.1",
23+
"nuxt": "3.16.1",
2424
"vue": "3.5.13",
2525
"vue-router": "4.5.0"
2626
},
2727
"devDependencies": {
28-
"typescript": "5.7.2",
29-
"vue-tsc": "2.2.0"
28+
"typescript": "5.8.2",
29+
"vue-tsc": "2.2.8"
3030
}
3131
}

examples/react-ts/package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@
1515
"@txnlab/use-wallet-react": "workspace:*",
1616
"@walletconnect/modal": "^2.7.0",
1717
"@walletconnect/sign-client": "^2.17.3",
18-
"algosdk": "3.0.0",
18+
"algosdk": "3.2.0",
1919
"lute-connect": "^1.5.1",
2020
"react": "18.3.1",
2121
"react-dom": "18.3.1"
2222
},
2323
"devDependencies": {
24-
"@types/react": "18.3.18",
24+
"@types/react": "18.3.20",
2525
"@types/react-dom": "18.3.5",
26-
"@typescript-eslint/eslint-plugin": "8.19.1",
27-
"@typescript-eslint/parser": "8.19.1",
26+
"@typescript-eslint/eslint-plugin": "8.28.0",
27+
"@typescript-eslint/parser": "8.28.0",
2828
"@vitejs/plugin-react": "4.3.4",
2929
"eslint": "8.57.1",
30-
"eslint-plugin-react-hooks": "5.1.0",
31-
"eslint-plugin-react-refresh": "0.4.16",
32-
"typescript": "5.7.2",
33-
"vite": "6.0.7"
30+
"eslint-plugin-react-hooks": "5.2.0",
31+
"eslint-plugin-react-refresh": "0.4.19",
32+
"typescript": "5.8.2",
33+
"vite": "6.2.3"
3434
}
3535
}

examples/solid-ts/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
"@txnlab/use-wallet-solid": "workspace:*",
1717
"@walletconnect/modal": "^2.7.0",
1818
"@walletconnect/sign-client": "^2.17.3",
19-
"algosdk": "3.0.0",
19+
"algosdk": "3.2.0",
2020
"lute-connect": "^1.5.1",
21-
"solid-js": "1.9.3"
21+
"solid-js": "1.9.5"
2222
},
2323
"devDependencies": {
24-
"typescript": "5.7.2",
25-
"vite": "6.0.7",
26-
"vite-plugin-solid": "2.11.0"
24+
"typescript": "5.8.2",
25+
"vite": "6.2.3",
26+
"vite-plugin-solid": "2.11.6"
2727
}
2828
}

examples/vanilla-ts/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
},
1212
"devDependencies": {
1313
"@walletconnect/types": "2.17.3",
14-
"typescript": "5.7.2",
15-
"vite": "6.0.7"
14+
"typescript": "5.8.2",
15+
"vite": "6.2.3"
1616
},
1717
"dependencies": {
1818
"@blockshake/defly-connect": "^1.2.1",
1919
"@perawallet/connect": "^1.4.1",
2020
"@txnlab/use-wallet": "workspace:*",
2121
"@walletconnect/modal": "^2.7.0",
2222
"@walletconnect/sign-client": "^2.17.3",
23-
"algosdk": "3.0.0",
23+
"algosdk": "3.2.0",
2424
"lute-connect": "^1.5.1"
2525
}
2626
}

examples/vue-ts/package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
"@txnlab/use-wallet-vue": "workspace:*",
1616
"@walletconnect/modal": "^2.7.0",
1717
"@walletconnect/sign-client": "^2.17.3",
18-
"algosdk": "3.0.0",
18+
"algosdk": "3.2.0",
1919
"lute-connect": "^1.5.1",
2020
"vue": "3.5.13"
2121
},
2222
"devDependencies": {
23-
"@vitejs/plugin-vue": "5.2.1",
24-
"typescript": "5.7.2",
25-
"vite": "6.0.7",
26-
"vue-tsc": "2.2.0"
23+
"@vitejs/plugin-vue": "5.2.3",
24+
"typescript": "5.8.2",
25+
"vite": "6.2.3",
26+
"vue-tsc": "2.2.8"
2727
}
2828
}

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "git",
66
"url": "https://github.com/txnlab/use-wallet.git"
77
},
8-
"packageManager": "[email protected].4",
8+
"packageManager": "[email protected].9",
99
"type": "module",
1010
"scripts": {
1111
"build": "pnpm build:packages && pnpm build:examples",
@@ -25,23 +25,23 @@
2525
"example:nuxt": "pnpm --filter \"./examples/nuxt\" dev"
2626
},
2727
"devDependencies": {
28-
"@playwright/test": "1.49.1",
28+
"@playwright/test": "1.51.1",
2929
"@testing-library/jest-dom": "6.6.3",
30-
"@testing-library/react": "16.1.0",
30+
"@testing-library/react": "16.2.0",
3131
"@types/node": "20.11.30",
32-
"@typescript-eslint/eslint-plugin": "8.19.1",
33-
"@typescript-eslint/parser": "8.19.1",
32+
"@typescript-eslint/eslint-plugin": "8.28.0",
33+
"@typescript-eslint/parser": "8.28.0",
3434
"@vitejs/plugin-react": "4.3.4",
35-
"@vitejs/plugin-vue": "5.2.1",
36-
"@vitejs/plugin-vue-jsx": "4.1.1",
35+
"@vitejs/plugin-vue": "5.2.3",
36+
"@vitejs/plugin-vue-jsx": "4.1.2",
3737
"@vue/test-utils": "2.4.6",
3838
"eslint": "8.57.1",
39-
"eslint-config-prettier": "9.1.0",
40-
"eslint-plugin-prettier": "5.2.1",
41-
"prettier": "3.4.2",
42-
"vite": "6.0.7",
43-
"vite-plugin-solid": "2.11.0",
44-
"vitest": "2.1.8",
39+
"eslint-config-prettier": "10.1.1",
40+
"eslint-plugin-prettier": "5.2.5",
41+
"prettier": "3.5.3",
42+
"vite": "6.2.3",
43+
"vite-plugin-solid": "^2.11.1",
44+
"vitest": "3.0.9",
4545
"vue-demi": "0.14.10"
4646
}
4747
}

packages/use-wallet-react/package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
"@txnlab/use-wallet": "workspace:*"
4343
},
4444
"devDependencies": {
45-
"@types/react": "18.3.18",
46-
"algosdk": "3.0.0",
47-
"jsdom": "25.0.1",
45+
"@types/react": "18.3.20",
46+
"algosdk": "3.2.0",
47+
"jsdom": "26.0.0",
4848
"react": "18.3.1",
4949
"react-dom": "18.3.1",
50-
"tsup": "8.3.5",
51-
"typescript": "5.7.2"
50+
"tsup": "8.4.0",
51+
"typescript": "5.8.2"
5252
},
5353
"peerDependencies": {
5454
"@blockshake/defly-connect": "^1.2.1",
@@ -59,8 +59,8 @@
5959
"algosdk": "^3.0.0",
6060
"lute-connect": "^1.5.1",
6161
"magic-sdk": "^28.21.0",
62-
"react": "^17.0.0 || ^18.0.0",
63-
"react-dom": "^17.0.0 || ^18.0.0"
62+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
63+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
6464
},
6565
"peerDependenciesMeta": {
6666
"@blockshake/defly-connect": {

packages/use-wallet-react/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"skipLibCheck": true,
99
"forceConsistentCasingInFileNames": true,
1010
"moduleResolution": "node",
11-
"jsx": "react",
11+
"jsx": "react-jsx",
1212
"noEmit": true,
1313
"baseUrl": ".",
1414
"rootDir": ".",

packages/use-wallet-solid/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@
6666
},
6767
"devDependencies": {
6868
"@solidjs/testing-library": "0.8.10",
69-
"algosdk": "3.0.0",
70-
"solid-js": "1.9.3",
71-
"tsup": "8.3.5",
69+
"algosdk": "3.2.0",
70+
"solid-js": "1.9.5",
71+
"tsup": "8.4.0",
7272
"tsup-preset-solid": "2.2.0",
73-
"typescript": "5.7.2"
73+
"typescript": "5.8.2"
7474
},
7575
"peerDependencies": {
7676
"@blockshake/defly-connect": "^1.2.1",

packages/use-wallet-solid/vitest.config.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
import solidPlugin from 'vite-plugin-solid'
12
import { defineConfig, mergeConfig } from 'vitest/config'
23
import viteConfig from './vite.config'
34

45
export default mergeConfig(
56
viteConfig,
67
defineConfig({
8+
plugins: [
9+
solidPlugin({
10+
ssr: false
11+
})
12+
],
713
test: {
814
name: 'use-wallet-solid',
915
dir: './src',

packages/use-wallet-vue/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
"@txnlab/use-wallet": "workspace:*"
4343
},
4444
"devDependencies": {
45-
"algosdk": "3.0.0",
46-
"tsup": "8.3.5",
47-
"typescript": "5.7.2",
45+
"algosdk": "3.2.0",
46+
"tsup": "8.4.0",
47+
"typescript": "5.8.2",
4848
"vue": "3.5.13"
4949
},
5050
"peerDependencies": {

packages/use-wallet/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@
5050
"@walletconnect/modal-core": "2.7.0",
5151
"@walletconnect/sign-client": "2.17.3",
5252
"@walletconnect/types": "2.17.3",
53-
"algosdk": "3.0.0",
53+
"algosdk": "3.2.0",
5454
"lute-connect": "1.5.1",
5555
"magic-sdk": "28.21.0",
56-
"tsup": "8.3.5",
57-
"typescript": "5.7.2"
56+
"tsup": "8.4.0",
57+
"typescript": "5.8.2"
5858
},
5959
"peerDependencies": {
6060
"@agoralabs-sh/avm-web-provider": "^1.7.0",
6161
"@blockshake/defly-connect": "^1.2.1",
6262
"@perawallet/connect": "^1.4.1",
6363
"@walletconnect/modal": "^2.7.0",
6464
"@walletconnect/sign-client": "^2.17.3",
65-
"algosdk": "^3.0.0",
65+
"algosdk": "^3.2.0",
6666
"lute-connect": "^1.5.1"
6767
},
6868
"peerDependenciesMeta": {

packages/use-wallet/src/__tests__/wallets/lute.test.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { StorageAdapter } from 'src/storage'
55
import { LOCAL_STORAGE_KEY, State, WalletState, DEFAULT_STATE } from 'src/store'
66
import { byteArrayToBase64 } from 'src/utils'
77
import { LuteWallet } from 'src/wallets/lute'
8-
import { SignTxnsError, WalletId } from 'src/wallets/types'
8+
import { WalletId } from 'src/wallets/types'
99
import type { Mock } from 'vitest'
1010

1111
// Mock logger
@@ -253,15 +253,15 @@ describe('LuteWallet', () => {
253253

254254
describe('signTransactions', () => {
255255
it('should re-throw SignTxnsError to the consuming application', async () => {
256-
const mockSignTxns = vi.fn().mockRejectedValue({
256+
const mockError = Object.assign(new Error('User Rejected Request'), { code: 4001 })
257+
const mockSignTxns = vi.fn().mockRejectedValue(mockError)
258+
vi.mocked(mockLuteConnect.signTxns).mockImplementation(mockSignTxns)
259+
260+
await expect(wallet.signTransactions([txn1])).rejects.toMatchObject({
261+
name: 'SignTxnsError',
257262
message: 'User Rejected Request',
258263
code: 4001
259264
})
260-
vi.mocked(mockLuteConnect.signTxns).mockImplementation(mockSignTxns)
261-
262-
await expect(wallet.signTransactions([txn1])).rejects.toThrow(
263-
new SignTxnsError('User Rejected Request', 4001)
264-
)
265265
})
266266

267267
it('should process and sign a single algosdk.Transaction', async () => {

packages/use-wallet/src/utils.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,11 @@ export function isTransactionArray(
116116
return false
117117
}
118118

119-
export function flattenTxnGroup<T>(txnGroup: T[]): T extends (infer U)[] ? U[] : T[] {
120-
return Array.isArray(txnGroup[0]) ? ((txnGroup as any[]).flat() as any) : txnGroup
119+
export function flattenTxnGroup<T>(txnGroup: T[]): T[] {
120+
if (!Array.isArray(txnGroup[0])) {
121+
return txnGroup
122+
}
123+
return (txnGroup as unknown as any[]).flat()
121124
}
122125

123126
function getPayloadId(): number {

0 commit comments

Comments
 (0)