diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index fadcd245..4351d998 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -63,6 +63,7 @@ const manager = new WalletManager({ WalletId.PERA, WalletId.EXODUS, WalletId.KIBISIS, + WalletId.LUTE, // Example of a wallet with optional customizations { @@ -89,12 +90,6 @@ const manager = new WalletManager({ apiKey: '' // Required } }, - { - id: WalletId.LUTE, - options: { - siteName: '' // Required - } - }, { id: WalletId.BIATEC, options: { diff --git a/docs/getting-started/supported-wallets.md b/docs/getting-started/supported-wallets.md index a8a6bfe1..00949ccf 100644 --- a/docs/getting-started/supported-wallets.md +++ b/docs/getting-started/supported-wallets.md @@ -115,11 +115,14 @@ Web and browser extension wallet with Ledger hardware support. [Installation ins ```typescript import { WalletId } from '@txnlab/use-wallet' -// Configuration required +// Basic usage (no options required) +WalletId.LUTE + +// With optional configuration { id: WalletId.LUTE, options: { - siteName: string // Required: Your site name + siteName?: string // Defaults to document title } } ``` diff --git a/examples/nextjs/package.json b/examples/nextjs/package.json index aca73d22..6aaf35f4 100644 --- a/examples/nextjs/package.json +++ b/examples/nextjs/package.json @@ -15,7 +15,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "3.2.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "next": "14.2.26", "react": "18.3.1", "react-dom": "18.3.1" diff --git a/examples/nextjs/src/app/providers.tsx b/examples/nextjs/src/app/providers.tsx index 927e8be6..6f5838bc 100644 --- a/examples/nextjs/src/app/providers.tsx +++ b/examples/nextjs/src/app/providers.tsx @@ -18,10 +18,7 @@ const walletManager = new WalletManager({ }, WalletId.KMD, WalletId.KIBISIS, - { - id: WalletId.LUTE, - options: { siteName: 'Example Site' } - }, + WalletId.LUTE, { id: WalletId.MAGIC, options: { apiKey: 'pk_live_D17FD8D89621B5F3' } diff --git a/examples/nuxt/package.json b/examples/nuxt/package.json index f46dd748..fd8ed3fb 100644 --- a/examples/nuxt/package.json +++ b/examples/nuxt/package.json @@ -19,7 +19,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "3.2.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "nuxt": "3.16.1", "vue": "3.5.13", "vue-router": "4.5.0" diff --git a/examples/nuxt/plugins/walletManager.client.ts b/examples/nuxt/plugins/walletManager.client.ts index cd2ae886..e0e72d81 100644 --- a/examples/nuxt/plugins/walletManager.client.ts +++ b/examples/nuxt/plugins/walletManager.client.ts @@ -18,10 +18,7 @@ export default defineNuxtPlugin((nuxtApp) => { }, WalletId.KMD, WalletId.KIBISIS, - { - id: WalletId.LUTE, - options: { siteName: 'Example Site' } - }, + WalletId.LUTE, { id: WalletId.MAGIC, options: { apiKey: 'pk_live_D17FD8D89621B5F3' } diff --git a/examples/react-ts/package.json b/examples/react-ts/package.json index 47e4d5f8..6c533f0d 100644 --- a/examples/react-ts/package.json +++ b/examples/react-ts/package.json @@ -16,7 +16,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "3.2.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "react": "18.3.1", "react-dom": "18.3.1" }, diff --git a/examples/react-ts/src/App.tsx b/examples/react-ts/src/App.tsx index ff725f15..9ab81c76 100644 --- a/examples/react-ts/src/App.tsx +++ b/examples/react-ts/src/App.tsx @@ -21,10 +21,7 @@ const walletManager = new WalletManager({ }, WalletId.KMD, WalletId.KIBISIS, - { - id: WalletId.LUTE, - options: { siteName: 'Example Site' } - }, + WalletId.LUTE, { id: WalletId.MAGIC, options: { apiKey: 'pk_live_D17FD8D89621B5F3' } diff --git a/examples/solid-ts/package.json b/examples/solid-ts/package.json index 6389ceab..158d47bb 100644 --- a/examples/solid-ts/package.json +++ b/examples/solid-ts/package.json @@ -17,7 +17,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "3.2.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "solid-js": "1.9.5" }, "devDependencies": { diff --git a/examples/solid-ts/src/App.tsx b/examples/solid-ts/src/App.tsx index ec461d74..d3dfa76e 100644 --- a/examples/solid-ts/src/App.tsx +++ b/examples/solid-ts/src/App.tsx @@ -21,10 +21,7 @@ const walletManager = new WalletManager({ }, WalletId.KMD, WalletId.KIBISIS, - { - id: WalletId.LUTE, - options: { siteName: 'Example Site' } - }, + WalletId.LUTE, { id: WalletId.MAGIC, options: { apiKey: 'pk_live_D17FD8D89621B5F3' } diff --git a/examples/vanilla-ts/package.json b/examples/vanilla-ts/package.json index dc4c2998..801da908 100644 --- a/examples/vanilla-ts/package.json +++ b/examples/vanilla-ts/package.json @@ -21,6 +21,6 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "3.2.0", - "lute-connect": "^1.4.1" + "lute-connect": "^1.5.1" } } diff --git a/examples/vanilla-ts/src/main.ts b/examples/vanilla-ts/src/main.ts index 3a0dad72..2f936ef5 100644 --- a/examples/vanilla-ts/src/main.ts +++ b/examples/vanilla-ts/src/main.ts @@ -21,10 +21,7 @@ const walletManager = new WalletManager({ }, WalletId.KMD, WalletId.KIBISIS, - { - id: WalletId.LUTE, - options: { siteName: 'Example Site' } - }, + WalletId.LUTE, { id: WalletId.MAGIC, options: { apiKey: 'pk_live_D17FD8D89621B5F3' } diff --git a/examples/vue-ts/package.json b/examples/vue-ts/package.json index 4ece0731..c85fbb6a 100644 --- a/examples/vue-ts/package.json +++ b/examples/vue-ts/package.json @@ -16,7 +16,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "3.2.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "vue": "3.5.13" }, "devDependencies": { diff --git a/examples/vue-ts/src/main.ts b/examples/vue-ts/src/main.ts index bf3dfd93..7f6a94e8 100644 --- a/examples/vue-ts/src/main.ts +++ b/examples/vue-ts/src/main.ts @@ -21,10 +21,7 @@ app.use(WalletManagerPlugin, { }, WalletId.KMD, WalletId.KIBISIS, - { - id: WalletId.LUTE, - options: { siteName: 'Example Site' } - }, + WalletId.LUTE, { id: WalletId.MAGIC, options: { apiKey: 'pk_live_D17FD8D89621B5F3' } diff --git a/packages/use-wallet-react/package.json b/packages/use-wallet-react/package.json index 937db7bd..827cd7a1 100644 --- a/packages/use-wallet-react/package.json +++ b/packages/use-wallet-react/package.json @@ -57,7 +57,7 @@ "@perawallet/connect": "^1.4.1", "@walletconnect/sign-client": "^2.17.3", "algosdk": "^3.0.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "magic-sdk": "^28.21.0", "react": "^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" diff --git a/packages/use-wallet-solid/package.json b/packages/use-wallet-solid/package.json index 28ec15f6..ed5a5f1c 100644 --- a/packages/use-wallet-solid/package.json +++ b/packages/use-wallet-solid/package.json @@ -79,7 +79,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "^3.0.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "magic-sdk": "^28.21.0" }, "peerDependenciesMeta": { diff --git a/packages/use-wallet-vue/package.json b/packages/use-wallet-vue/package.json index 4bea13b9..dc6127aa 100644 --- a/packages/use-wallet-vue/package.json +++ b/packages/use-wallet-vue/package.json @@ -54,7 +54,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "^3.0.0", - "lute-connect": "^1.4.1", + "lute-connect": "^1.5.1", "magic-sdk": "^28.21.0", "vue": "^3.0.0" }, diff --git a/packages/use-wallet/package.json b/packages/use-wallet/package.json index b6079b7e..bd25135c 100644 --- a/packages/use-wallet/package.json +++ b/packages/use-wallet/package.json @@ -51,7 +51,7 @@ "@walletconnect/sign-client": "2.17.3", "@walletconnect/types": "2.17.3", "algosdk": "3.2.0", - "lute-connect": "1.4.1", + "lute-connect": "1.5.1", "magic-sdk": "28.21.0", "tsup": "8.4.0", "typescript": "5.8.2" @@ -63,7 +63,7 @@ "@walletconnect/modal": "^2.7.0", "@walletconnect/sign-client": "^2.17.3", "algosdk": "^3.0.0", - "lute-connect": "^1.4.1" + "lute-connect": "^1.5.1" }, "peerDependenciesMeta": { "@agoralabs-sh/avm-web-provider": { diff --git a/packages/use-wallet/src/wallets/lute.ts b/packages/use-wallet/src/wallets/lute.ts index 09a9faff..816aee02 100644 --- a/packages/use-wallet/src/wallets/lute.ts +++ b/packages/use-wallet/src/wallets/lute.ts @@ -37,14 +37,10 @@ export class LuteWallet extends BaseWallet { store, subscribe, getAlgodClient, - options, + options = {}, metadata = {} }: WalletConstructor) { super({ id, metadata, getAlgodClient, store, subscribe }) - if (!options?.siteName) { - this.logger.error('Missing required option: siteName') - throw new Error('Missing required option: siteName') - } this.options = options this.store = store } @@ -59,7 +55,7 @@ export class LuteWallet extends BaseWallet { const module = await import('lute-connect') const LuteConnect = module.default - const client = new LuteConnect(this.options.siteName as string) + const client = new LuteConnect(this.options?.siteName) this.client = client this.logger.info('Client initialized') return client diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 99593f77..023ab3ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -84,8 +84,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 next: specifier: 14.2.26 version: 14.2.26(@babel/core@7.26.0)(@playwright/test@1.51.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -139,8 +139,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 nuxt: specifier: 3.16.1 version: 3.16.1(@parcel/watcher@2.5.0)(@types/node@20.11.30)(bufferutil@4.0.9)(db0@0.3.1)(eslint@8.57.1)(idb-keyval@6.2.1)(ioredis@5.6.0)(magicast@0.3.5)(optionator@0.9.4)(rollup@4.38.0)(terser@5.37.0)(typescript@5.8.2)(utf-8-validate@5.0.10)(vite@6.2.3(@types/node@20.11.30)(jiti@2.4.2)(terser@5.37.0)(yaml@2.7.0))(vue-tsc@2.2.8(typescript@5.8.2))(yaml@2.7.0) @@ -179,8 +179,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 react: specifier: 18.3.1 version: 18.3.1 @@ -240,8 +240,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 solid-js: specifier: 1.9.5 version: 1.9.5 @@ -277,8 +277,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 devDependencies: '@walletconnect/types': specifier: 2.17.3 @@ -311,8 +311,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 vue: specifier: 3.5.13 version: 3.5.13(typescript@5.8.2) @@ -370,8 +370,8 @@ importers: specifier: 3.2.0 version: 3.2.0 lute-connect: - specifier: 1.4.1 - version: 1.4.1 + specifier: 1.5.1 + version: 1.5.1 magic-sdk: specifier: 28.21.0 version: 28.21.0 @@ -406,8 +406,8 @@ importers: specifier: ^2.17.3 version: 2.17.3(bufferutil@4.0.9)(db0@0.3.1)(ioredis@5.6.0)(utf-8-validate@5.0.10) lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 magic-sdk: specifier: ^28.21.0 version: 28.21.0 @@ -458,8 +458,8 @@ importers: specifier: ^2.17.3 version: 2.17.3(bufferutil@4.0.9)(db0@0.3.1)(ioredis@5.6.0)(utf-8-validate@5.0.10) lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 magic-sdk: specifier: ^28.21.0 version: 28.21.0 @@ -507,8 +507,8 @@ importers: specifier: ^2.17.3 version: 2.17.3(bufferutil@4.0.9)(db0@0.3.1)(ioredis@5.6.0)(utf-8-validate@5.0.10) lute-connect: - specifier: ^1.4.1 - version: 1.4.1 + specifier: ^1.5.1 + version: 1.5.1 magic-sdk: specifier: ^28.21.0 version: 28.21.0 @@ -4133,8 +4133,8 @@ packages: lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - lute-connect@1.4.1: - resolution: {integrity: sha512-mOiu0NzXR4Ep8w8xBBVX3naoM9/VMPudZZWrtRS6pk+g83czfzmoMwlsuzUltC/t+UrNFlSP8xKp2M9bmYtf8Q==} + lute-connect@1.5.1: + resolution: {integrity: sha512-R7155BuCczZhwYf7tQv3tf4sE4Pwx9RuZSZPg+eAEPcnT6K09w9wY91MdPX+sJIJrgUV0vOeZGYHQcW4xKM8Zw==} lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} @@ -10811,7 +10811,7 @@ snapshots: dependencies: yallist: 3.1.1 - lute-connect@1.4.1: {} + lute-connect@1.5.1: {} lz-string@1.5.0: {}