@txnlab/use-wallet-vue 3.0.0-rc.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +4 -3
- package/dist/index.cjs +0 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# @txnlab/use-wallet-vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@txnlab/use-wallet?activeTab=versions)
|
|
4
|
+
[](https://github.com/TxnLab/use-wallet/blob/main/LICENSE.md)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Vue adapter for [@txnlab/use-wallet](https://github.com/TxnLab/use-wallet)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
### Visit [txnlab.gitbook.io/use-wallet](https://txnlab.gitbook.io/use-wallet) for docs, guides, and examples!
|
package/dist/index.cjs
CHANGED
|
@@ -77,7 +77,6 @@ function useWallet() {
|
|
|
77
77
|
if (networkId === activeNetwork.value) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
await manager.disconnect();
|
|
81
80
|
console.info(`[Vue] Creating Algodv2 client for ${networkId}...`);
|
|
82
81
|
const { token, baseServer, port, headers } = manager.networkConfig[networkId];
|
|
83
82
|
const newClient = new import_algosdk.default.Algodv2(token, baseServer, port, headers);
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/walletManagerPlugin.ts","../src/useWallet.ts"],"sourcesContent":["export * from '@txnlab/use-wallet'\nexport { WalletManagerPlugin } from './walletManagerPlugin'\nexport { useWallet, type Wallet } from './useWallet'\n","import { WalletManager, type WalletManagerConfig } from '@txnlab/use-wallet'\nimport { ref } from 'vue'\nimport type algosdk from 'algosdk'\n\nexport const WalletManagerPlugin = {\n install(app: any, options: WalletManagerConfig) {\n const manager = new WalletManager(options)\n const algodClient = ref(manager.algodClient)\n\n const setAlgodClient = (client: algosdk.Algodv2) => {\n algodClient.value = client\n manager.algodClient = client\n }\n\n app.provide('walletManager', manager)\n app.provide('algodClient', algodClient)\n app.provide('setAlgodClient', setAlgodClient)\n\n manager.resumeSessions().catch((error) => {\n console.error('Error resuming sessions:', error)\n })\n }\n}\n","import { useStore } from '@tanstack/vue-store'\nimport {\n NetworkId,\n WalletManager,\n type WalletAccount,\n type WalletMetadata\n} from '@txnlab/use-wallet'\nimport algosdk from 'algosdk'\nimport { computed, inject, ref } from 'vue'\n\nexport interface Wallet {\n id: string\n metadata: WalletMetadata\n accounts: WalletAccount[]\n activeAccount: WalletAccount | null\n isConnected: boolean\n isActive: boolean\n connect: (args?: Record<string, any>) => Promise<WalletAccount[]>\n disconnect: () => Promise<void>\n setActive: () => void\n setActiveAccount: (address: string) => void\n}\n\nexport type SetAlgodClient = (client: algosdk.Algodv2) => void\n\nexport function useWallet() {\n const manager = inject<WalletManager>('walletManager')\n const algodClient = inject<ReturnType<typeof ref<algosdk.Algodv2>>>('algodClient')\n const setAlgodClient = inject<SetAlgodClient>('setAlgodClient') as SetAlgodClient\n\n if (!manager) {\n throw new Error('WalletManager plugin is not properly installed')\n }\n if (!algodClient || !setAlgodClient) {\n throw new Error('Algod client or setter not properly installed')\n }\n\n const activeNetwork = useStore(manager.store, (state) => state.activeNetwork)\n const setActiveNetwork = async (networkId: NetworkId): Promise<void> => {\n if (networkId === activeNetwork.value) {\n return\n }\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/walletManagerPlugin.ts","../src/useWallet.ts"],"sourcesContent":["export * from '@txnlab/use-wallet'\nexport { WalletManagerPlugin } from './walletManagerPlugin'\nexport { useWallet, type Wallet } from './useWallet'\n","import { WalletManager, type WalletManagerConfig } from '@txnlab/use-wallet'\nimport { ref } from 'vue'\nimport type algosdk from 'algosdk'\n\nexport const WalletManagerPlugin = {\n install(app: any, options: WalletManagerConfig) {\n const manager = new WalletManager(options)\n const algodClient = ref(manager.algodClient)\n\n const setAlgodClient = (client: algosdk.Algodv2) => {\n algodClient.value = client\n manager.algodClient = client\n }\n\n app.provide('walletManager', manager)\n app.provide('algodClient', algodClient)\n app.provide('setAlgodClient', setAlgodClient)\n\n manager.resumeSessions().catch((error) => {\n console.error('Error resuming sessions:', error)\n })\n }\n}\n","import { useStore } from '@tanstack/vue-store'\nimport {\n NetworkId,\n WalletManager,\n type WalletAccount,\n type WalletMetadata\n} from '@txnlab/use-wallet'\nimport algosdk from 'algosdk'\nimport { computed, inject, ref } from 'vue'\n\nexport interface Wallet {\n id: string\n metadata: WalletMetadata\n accounts: WalletAccount[]\n activeAccount: WalletAccount | null\n isConnected: boolean\n isActive: boolean\n connect: (args?: Record<string, any>) => Promise<WalletAccount[]>\n disconnect: () => Promise<void>\n setActive: () => void\n setActiveAccount: (address: string) => void\n}\n\nexport type SetAlgodClient = (client: algosdk.Algodv2) => void\n\nexport function useWallet() {\n const manager = inject<WalletManager>('walletManager')\n const algodClient = inject<ReturnType<typeof ref<algosdk.Algodv2>>>('algodClient')\n const setAlgodClient = inject<SetAlgodClient>('setAlgodClient') as SetAlgodClient\n\n if (!manager) {\n throw new Error('WalletManager plugin is not properly installed')\n }\n if (!algodClient || !setAlgodClient) {\n throw new Error('Algod client or setter not properly installed')\n }\n\n const activeNetwork = useStore(manager.store, (state) => state.activeNetwork)\n const setActiveNetwork = async (networkId: NetworkId): Promise<void> => {\n if (networkId === activeNetwork.value) {\n return\n }\n\n console.info(`[Vue] Creating Algodv2 client for ${networkId}...`)\n\n const { token, baseServer, port, headers } = manager.networkConfig[networkId]\n const newClient = new algosdk.Algodv2(token, baseServer, port, headers)\n setAlgodClient(newClient)\n\n manager.store.setState((state) => ({\n ...state,\n activeNetwork: networkId\n }))\n\n console.info(`[Vue] ✅ Active network set to ${networkId}.`)\n }\n\n const walletStateMap = useStore(manager.store, (state) => state.wallets)\n const activeWalletId = useStore(manager.store, (state) => state.activeWallet)\n\n const wallets = computed(() => {\n return [...manager.wallets.values()].map((wallet): Wallet => {\n const walletState = walletStateMap.value[wallet.id]\n\n return {\n id: wallet.id,\n metadata: wallet.metadata,\n accounts: walletState?.accounts ?? [],\n activeAccount: walletState?.activeAccount ?? null,\n isConnected: !!walletState,\n isActive: wallet.id === activeWalletId.value,\n connect: (args) => wallet.connect(args),\n disconnect: () => wallet.disconnect(),\n setActive: () => wallet.setActive(),\n setActiveAccount: (addr) => wallet.setActiveAccount(addr)\n }\n })\n })\n\n const activeWallet = computed(() => {\n return activeWalletId.value ? manager.getWallet(activeWalletId.value) || null : null\n })\n\n const activeWalletState = computed(() => {\n const wallet = activeWallet.value\n return wallet ? walletStateMap.value[wallet.id] || null : null\n })\n\n const activeWalletAccounts = computed(() => {\n return activeWalletState.value?.accounts ?? null\n })\n\n const activeWalletAddresses = computed(() => {\n return activeWalletAccounts.value?.map((account) => account.address) ?? null\n })\n\n const activeAccount = computed(() => {\n return activeWalletState.value?.activeAccount ?? null\n })\n\n const activeAddress = computed(() => {\n return activeAccount.value?.address ?? null\n })\n\n const signTransactions = <T extends algosdk.Transaction[] | Uint8Array[]>(\n txnGroup: T | T[],\n indexesToSign?: number[]\n ): Promise<(Uint8Array | null)[]> => {\n if (!activeWallet.value) {\n throw new Error('No active wallet')\n }\n return activeWallet.value.signTransactions(txnGroup, indexesToSign)\n }\n\n const transactionSigner = (\n txnGroup: algosdk.Transaction[],\n indexesToSign: number[]\n ): Promise<Uint8Array[]> => {\n if (!activeWallet.value) {\n throw new Error('No active wallet')\n }\n return activeWallet.value.transactionSigner(txnGroup, indexesToSign)\n }\n\n return {\n wallets,\n algodClient: computed(() => {\n if (!algodClient.value) {\n throw new Error('Algod client is undefined')\n }\n return algodClient.value\n }),\n activeNetwork,\n activeWallet,\n activeWalletAccounts,\n activeWalletAddresses,\n activeAccount,\n activeAddress,\n setActiveNetwork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AC;AAED,QAAM,4BAAwB,sBAAS,MAAM;AAC3C,WAAO,qBAAqB,OAAO,IAAI,CAAC,YAAY,QAAQ,OAAO,KAAK;AAAA,EAC1E,CAAC;AAED,QAAM,oBAAgB,sBAAS,MAAM;AACnC,WAAO,kBAAkB,OAAO,iBAAiB;AAAA,EACnD,CAAC;AAED,QAAM,oBAAgB,sBAAS,MAAM;AACnC,WAAO,cAAc,OAAO,WAAW;AAAA,EACzC,CAAC;AAED,QAAM,mBAAmB,CACvB,UACA,kBACmC;AACnC,QAAI,CAAC,aAAa,OAAO;AACvB,YAAM,IAAI,MAAM,kBAAkB;AAAA,IACpC;AACA,WAAO,aAAa,MAAM,iBAAiB,UAAU,aAAa;AAAA,EACpE;AAEA,QAAM,oBAAoB,CACxB,UACA,kBAC0B;AAC1B,QAAI,CAAC,aAAa,OAAO;AACvB,YAAM,IAAI,MAAM,kBAAkB;AAAA,IACpC;AACA,WAAO,aAAa,MAAM,kBAAkB,UAAU,aAAa;AAAA,EACrE;AAEA,SAAO;AAAA,IACL;AAAA,IACA,iBAAa,sBAAS,MAAM;AAC1B,UAAI,CAAC,YAAY,OAAO;AACtB,cAAM,IAAI,MAAM,2BAA2B;AAAA,MAC7C;AACA,aAAO,YAAY;AAAA,IACrB,CAAC;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;","names":["import_use_wallet","import_vue","algosdk"]}
|
package/dist/index.js
CHANGED
|
@@ -41,7 +41,6 @@ function useWallet() {
|
|
|
41
41
|
if (networkId === activeNetwork.value) {
|
|
42
42
|
return;
|
|
43
43
|
}
|
|
44
|
-
await manager.disconnect();
|
|
45
44
|
console.info(`[Vue] Creating Algodv2 client for ${networkId}...`);
|
|
46
45
|
const { token, baseServer, port, headers } = manager.networkConfig[networkId];
|
|
47
46
|
const newClient = new algosdk.Algodv2(token, baseServer, port, headers);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/walletManagerPlugin.ts","../src/useWallet.ts"],"sourcesContent":["export * from '@txnlab/use-wallet'\nexport { WalletManagerPlugin } from './walletManagerPlugin'\nexport { useWallet, type Wallet } from './useWallet'\n","import { WalletManager, type WalletManagerConfig } from '@txnlab/use-wallet'\nimport { ref } from 'vue'\nimport type algosdk from 'algosdk'\n\nexport const WalletManagerPlugin = {\n install(app: any, options: WalletManagerConfig) {\n const manager = new WalletManager(options)\n const algodClient = ref(manager.algodClient)\n\n const setAlgodClient = (client: algosdk.Algodv2) => {\n algodClient.value = client\n manager.algodClient = client\n }\n\n app.provide('walletManager', manager)\n app.provide('algodClient', algodClient)\n app.provide('setAlgodClient', setAlgodClient)\n\n manager.resumeSessions().catch((error) => {\n console.error('Error resuming sessions:', error)\n })\n }\n}\n","import { useStore } from '@tanstack/vue-store'\nimport {\n NetworkId,\n WalletManager,\n type WalletAccount,\n type WalletMetadata\n} from '@txnlab/use-wallet'\nimport algosdk from 'algosdk'\nimport { computed, inject, ref } from 'vue'\n\nexport interface Wallet {\n id: string\n metadata: WalletMetadata\n accounts: WalletAccount[]\n activeAccount: WalletAccount | null\n isConnected: boolean\n isActive: boolean\n connect: (args?: Record<string, any>) => Promise<WalletAccount[]>\n disconnect: () => Promise<void>\n setActive: () => void\n setActiveAccount: (address: string) => void\n}\n\nexport type SetAlgodClient = (client: algosdk.Algodv2) => void\n\nexport function useWallet() {\n const manager = inject<WalletManager>('walletManager')\n const algodClient = inject<ReturnType<typeof ref<algosdk.Algodv2>>>('algodClient')\n const setAlgodClient = inject<SetAlgodClient>('setAlgodClient') as SetAlgodClient\n\n if (!manager) {\n throw new Error('WalletManager plugin is not properly installed')\n }\n if (!algodClient || !setAlgodClient) {\n throw new Error('Algod client or setter not properly installed')\n }\n\n const activeNetwork = useStore(manager.store, (state) => state.activeNetwork)\n const setActiveNetwork = async (networkId: NetworkId): Promise<void> => {\n if (networkId === activeNetwork.value) {\n return\n }\n
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/walletManagerPlugin.ts","../src/useWallet.ts"],"sourcesContent":["export * from '@txnlab/use-wallet'\nexport { WalletManagerPlugin } from './walletManagerPlugin'\nexport { useWallet, type Wallet } from './useWallet'\n","import { WalletManager, type WalletManagerConfig } from '@txnlab/use-wallet'\nimport { ref } from 'vue'\nimport type algosdk from 'algosdk'\n\nexport const WalletManagerPlugin = {\n install(app: any, options: WalletManagerConfig) {\n const manager = new WalletManager(options)\n const algodClient = ref(manager.algodClient)\n\n const setAlgodClient = (client: algosdk.Algodv2) => {\n algodClient.value = client\n manager.algodClient = client\n }\n\n app.provide('walletManager', manager)\n app.provide('algodClient', algodClient)\n app.provide('setAlgodClient', setAlgodClient)\n\n manager.resumeSessions().catch((error) => {\n console.error('Error resuming sessions:', error)\n })\n }\n}\n","import { useStore } from '@tanstack/vue-store'\nimport {\n NetworkId,\n WalletManager,\n type WalletAccount,\n type WalletMetadata\n} from '@txnlab/use-wallet'\nimport algosdk from 'algosdk'\nimport { computed, inject, ref } from 'vue'\n\nexport interface Wallet {\n id: string\n metadata: WalletMetadata\n accounts: WalletAccount[]\n activeAccount: WalletAccount | null\n isConnected: boolean\n isActive: boolean\n connect: (args?: Record<string, any>) => Promise<WalletAccount[]>\n disconnect: () => Promise<void>\n setActive: () => void\n setActiveAccount: (address: string) => void\n}\n\nexport type SetAlgodClient = (client: algosdk.Algodv2) => void\n\nexport function useWallet() {\n const manager = inject<WalletManager>('walletManager')\n const algodClient = inject<ReturnType<typeof ref<algosdk.Algodv2>>>('algodClient')\n const setAlgodClient = inject<SetAlgodClient>('setAlgodClient') as SetAlgodClient\n\n if (!manager) {\n throw new Error('WalletManager plugin is not properly installed')\n }\n if (!algodClient || !setAlgodClient) {\n throw new Error('Algod client or setter not properly installed')\n }\n\n const activeNetwork = useStore(manager.store, (state) => state.activeNetwork)\n const setActiveNetwork = async (networkId: NetworkId): Promise<void> => {\n if (networkId === activeNetwork.value) {\n return\n }\n\n console.info(`[Vue] Creating Algodv2 client for ${networkId}...`)\n\n const { token, baseServer, port, headers } = manager.networkConfig[networkId]\n const newClient = new algosdk.Algodv2(token, baseServer, port, headers)\n setAlgodClient(newClient)\n\n manager.store.setState((state) => ({\n ...state,\n activeNetwork: networkId\n }))\n\n console.info(`[Vue] ✅ Active network set to ${networkId}.`)\n }\n\n const walletStateMap = useStore(manager.store, (state) => state.wallets)\n const activeWalletId = useStore(manager.store, (state) => state.activeWallet)\n\n const wallets = computed(() => {\n return [...manager.wallets.values()].map((wallet): Wallet => {\n const walletState = walletStateMap.value[wallet.id]\n\n return {\n id: wallet.id,\n metadata: wallet.metadata,\n accounts: walletState?.accounts ?? [],\n activeAccount: walletState?.activeAccount ?? null,\n isConnected: !!walletState,\n isActive: wallet.id === activeWalletId.value,\n connect: (args) => wallet.connect(args),\n disconnect: () => wallet.disconnect(),\n setActive: () => wallet.setActive(),\n setActiveAccount: (addr) => wallet.setActiveAccount(addr)\n }\n })\n })\n\n const activeWallet = computed(() => {\n return activeWalletId.value ? manager.getWallet(activeWalletId.value) || null : null\n })\n\n const activeWalletState = computed(() => {\n const wallet = activeWallet.value\n return wallet ? walletStateMap.value[wallet.id] || null : null\n })\n\n const activeWalletAccounts = computed(() => {\n return activeWalletState.value?.accounts ?? null\n })\n\n const activeWalletAddresses = computed(() => {\n return activeWalletAccounts.value?.map((account) => account.address) ?? null\n })\n\n const activeAccount = computed(() => {\n return activeWalletState.value?.activeAccount ?? null\n })\n\n const activeAddress = computed(() => {\n return activeAccount.value?.address ?? null\n })\n\n const signTransactions = <T extends algosdk.Transaction[] | Uint8Array[]>(\n txnGroup: T | T[],\n indexesToSign?: number[]\n ): Promise<(Uint8Array | null)[]> => {\n if (!activeWallet.value) {\n throw new Error('No active wallet')\n }\n return activeWallet.value.signTransactions(txnGroup, indexesToSign)\n }\n\n const transactionSigner = (\n txnGroup: algosdk.Transaction[],\n indexesToSign: number[]\n ): Promise<Uint8Array[]> => {\n if (!activeWallet.value) {\n throw new Error('No active wallet')\n }\n return activeWallet.value.transactionSigner(txnGroup, indexesToSign)\n }\n\n return {\n wallets,\n algodClient: computed(() => {\n if (!algodClient.value) {\n throw new Error('Algod client is undefined')\n }\n return algodClient.value\n }),\n activeNetwork,\n activeWallet,\n activeWalletAccounts,\n activeWalletAddresses,\n activeAccount,\n activeAddress,\n setActiveNetwork,\n setAlgodClient,\n signTransactions,\n transactionSigner\n }\n}\n"],"mappings":";AAAA,cAAc;;;ACAd,SAAS,qBAA+C;AACxD,SAAS,WAAW;AAGb,IAAM,sBAAsB;AAAA,EACjC,QAAQ,KAAU,SAA8B;AAC9C,UAAM,UAAU,IAAI,cAAc,OAAO;AACzC,UAAM,cAAc,IAAI,QAAQ,WAAW;AAE3C,UAAM,iBAAiB,CAAC,WAA4B;AAClD,kBAAY,QAAQ;AACpB,cAAQ,cAAc;AAAA,IACxB;AAEA,QAAI,QAAQ,iBAAiB,OAAO;AACpC,QAAI,QAAQ,eAAe,WAAW;AACtC,QAAI,QAAQ,kBAAkB,cAAc;AAE5C,YAAQ,eAAe,EAAE,MAAM,CAAC,UAAU;AACxC,cAAQ,MAAM,4BAA4B,KAAK;AAAA,IACjD,CAAC;AAAA,EACH;AACF;;;ACtBA,SAAS,gBAAgB;AACzB,OAKO;AACP,OAAO,aAAa;AACpB,SAAS,UAAU,cAAmB;AAiB/B,SAAS,YAAY;AAC1B,QAAM,UAAU,OAAsB,eAAe;AACrD,QAAM,cAAc,OAAgD,aAAa;AACjF,QAAM,iBAAiB,OAAuB,gBAAgB;AAE9D,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AACA,MAAI,CAAC,eAAe,CAAC,gBAAgB;AACnC,UAAM,IAAI,MAAM,+CAA+C;AAAA,EACjE;AAEA,QAAM,gBAAgB,SAAS,QAAQ,OAAO,CAAC,UAAU,MAAM,aAAa;AAC5E,QAAM,m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"3.0.0",
|
|
4
4
|
"description": "Vue library for integrating Algorand wallets into decentralized applications",
|
|
5
5
|
"author": "Doug Richar <drichar@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@tanstack/vue-store": "0.4.1",
|
|
34
|
-
"@txnlab/use-wallet": "3.0.0
|
|
34
|
+
"@txnlab/use-wallet": "3.0.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"algosdk": "2.
|
|
38
|
-
"tsup": "
|
|
39
|
-
"typescript": "
|
|
40
|
-
"vue": "
|
|
37
|
+
"algosdk": "2.8.0",
|
|
38
|
+
"tsup": "8.0.2",
|
|
39
|
+
"typescript": "5.4.3",
|
|
40
|
+
"vue": "3.4.21"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@blockshake/defly-connect": "^1.1.6",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@walletconnect/modal": "^2.6.2",
|
|
48
48
|
"@walletconnect/sign-client": "^2.10.2",
|
|
49
49
|
"algosdk": "^2.7.0",
|
|
50
|
-
"lute-connect": "^1.
|
|
50
|
+
"lute-connect": "^1.3.0",
|
|
51
51
|
"magic-sdk": "^28.0.3",
|
|
52
52
|
"vue": "^3.0.0"
|
|
53
53
|
},
|