@txnlab/use-wallet 4.1.0 → 4.3.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/dist/index.d.cts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { Store } from '@tanstack/store';
2
- import algosdk from 'algosdk';
2
+ import algosdk, { Transaction } from 'algosdk';
3
3
  import AVMWebProviderSDK from '@agoralabs-sh/avm-web-provider';
4
+ import { LiquidAuthClient, LiquidOptions } from '@algorandfoundation/liquid-auth-use-wallet-client';
5
+ export { LiquidOptions } from '@algorandfoundation/liquid-auth-use-wallet-client';
4
6
  import { InstanceWithExtensions, SDKBase } from '@magic-sdk/provider';
5
7
  import { AlgorandExtension } from '@magic-ext/algorand';
6
8
  import { MagicUserMetadata } from 'magic-sdk';
@@ -183,6 +185,7 @@ declare abstract class AVMProvider extends BaseWallet {
183
185
  signTransactions<T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]): Promise<(Uint8Array | null)[]>;
184
186
  }
185
187
 
188
+ declare const DEFLY_WEB_PROVIDER_ID = "95426e60-5f2e-49e9-b912-c488577be962";
186
189
  declare class DeflyWebWallet extends AVMProvider {
187
190
  constructor({ id, store, subscribe, getAlgodClient, metadata }: WalletConstructor<WalletId.DEFLY_WEB>);
188
191
  static defaultMetadata: {
@@ -354,6 +357,22 @@ declare class KmdWallet extends BaseWallet {
354
357
  private fetchAccounts;
355
358
  }
356
359
 
360
+ declare class LiquidWallet extends BaseWallet {
361
+ protected store: Store<State>;
362
+ authClient: LiquidAuthClient | undefined | null;
363
+ private options;
364
+ constructor({ id, store, subscribe, getAlgodClient, options, metadata }: WalletConstructor<WalletId.LIQUID>);
365
+ static defaultMetadata: {
366
+ name: string;
367
+ icon: string;
368
+ };
369
+ private initializeClient;
370
+ connect: (_args?: Record<string, any>) => Promise<WalletAccount[]>;
371
+ disconnect: () => Promise<void>;
372
+ resumeSession: () => Promise<void>;
373
+ signTransactions: <T extends Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
374
+ }
375
+
357
376
  interface LuteConnectOptions {
358
377
  siteName?: string;
359
378
  }
@@ -505,6 +524,28 @@ declare class BiatecWallet extends WalletConnect {
505
524
  };
506
525
  }
507
526
 
527
+ interface W3WalletProvider {
528
+ isConnected: () => Promise<boolean>;
529
+ account: () => Promise<WalletAccount>;
530
+ signTxns: (transactions: WalletTransaction[]) => Promise<(string | null)[]>;
531
+ }
532
+ declare class W3Wallet extends BaseWallet {
533
+ private client;
534
+ protected store: Store<State>;
535
+ constructor({ id, store, subscribe, getAlgodClient, metadata }: WalletConstructor<WalletId.W3_WALLET>);
536
+ static defaultMetadata: {
537
+ name: string;
538
+ icon: string;
539
+ };
540
+ private initializeClient;
541
+ connect: () => Promise<WalletAccount[]>;
542
+ disconnect: () => Promise<void>;
543
+ resumeSession: () => Promise<void>;
544
+ private processTxns;
545
+ private processEncodedTxns;
546
+ signTransactions: <T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
547
+ }
548
+
508
549
  declare enum WalletId {
509
550
  BIATEC = "biatec",
510
551
  DEFLY = "defly",
@@ -513,11 +554,13 @@ declare enum WalletId {
513
554
  EXODUS = "exodus",
514
555
  KIBISIS = "kibisis",
515
556
  KMD = "kmd",
557
+ LIQUID = "liquid",
516
558
  LUTE = "lute",
517
559
  MAGIC = "magic",
518
560
  MNEMONIC = "mnemonic",
519
561
  PERA = "pera",
520
- WALLETCONNECT = "walletconnect"
562
+ WALLETCONNECT = "walletconnect",
563
+ W3_WALLET = "w3-wallet"
521
564
  }
522
565
  type WalletMap = {
523
566
  [WalletId.BIATEC]: typeof BiatecWallet;
@@ -527,11 +570,13 @@ type WalletMap = {
527
570
  [WalletId.EXODUS]: typeof ExodusWallet;
528
571
  [WalletId.KIBISIS]: typeof KibisisWallet;
529
572
  [WalletId.KMD]: typeof KmdWallet;
573
+ [WalletId.LIQUID]: typeof LiquidWallet;
530
574
  [WalletId.LUTE]: typeof LuteWallet;
531
575
  [WalletId.MAGIC]: typeof MagicAuth;
532
576
  [WalletId.MNEMONIC]: typeof MnemonicWallet;
533
577
  [WalletId.PERA]: typeof PeraWallet;
534
578
  [WalletId.WALLETCONNECT]: typeof WalletConnect;
579
+ [WalletId.W3_WALLET]: typeof W3Wallet;
535
580
  };
536
581
  type WalletOptionsMap = {
537
582
  [WalletId.BIATEC]: WalletConnectOptions;
@@ -541,11 +586,13 @@ type WalletOptionsMap = {
541
586
  [WalletId.EXODUS]: ExodusOptions;
542
587
  [WalletId.KIBISIS]: Record<string, never>;
543
588
  [WalletId.KMD]: KmdOptions;
589
+ [WalletId.LIQUID]: LiquidOptions;
544
590
  [WalletId.LUTE]: LuteConnectOptions;
545
591
  [WalletId.MAGIC]: MagicAuthOptions;
546
592
  [WalletId.MNEMONIC]: MnemonicOptions;
547
593
  [WalletId.PERA]: PeraWalletConnectOptions;
548
594
  [WalletId.WALLETCONNECT]: WalletConnectOptions;
595
+ [WalletId.W3_WALLET]: Record<string, never>;
549
596
  };
550
597
  type SupportedWallet = WalletIdConfig<WalletId> | WalletId;
551
598
  type WalletConfigMap = {
@@ -788,6 +835,7 @@ declare class StorageAdapter {
788
835
  */
789
836
  declare const webpackFallback: {
790
837
  '@agoralabs-sh/avm-web-provider': boolean;
838
+ '@algorandfoundation/liquid-auth-use-wallet-client': boolean;
791
839
  '@blockshake/defly-connect': boolean;
792
840
  '@magic-ext/algorand': boolean;
793
841
  '@perawallet/connect': boolean;
@@ -797,4 +845,4 @@ declare const webpackFallback: {
797
845
  'magic-sdk': boolean;
798
846
  };
799
847
 
800
- export { type AlgodConfig, BaseWallet, type BaseWalletConstructor, type CustomProvider, CustomWallet, type CustomWalletOptions, DEFAULT_NETWORK_CONFIG, DEFAULT_STATE, DeflyWallet, type DeflyWalletConnectOptions, type EnableResult, type Exodus, type ExodusOptions, ExodusWallet, ICON, type JsonRpcRequest, KIBISIS_AVM_WEB_PROVIDER_ID, KibisisWallet, type KmdOptions, KmdWallet, LOCAL_STORAGE_MNEMONIC_KEY, LogLevel, MagicAuth, type MagicAuthClient, type MagicAuthOptions, type ManagerStatus, type MnemonicOptions, MnemonicWallet, type MultisigMetadata, type NetworkConfig, NetworkConfigBuilder, NetworkId, PeraWallet, type PeraWalletConnectOptions, ScopeType, SessionError, type SignData, SignDataError, type SignDataResponse, type SignMetadata, SignTxnsError, type SignTxnsResponse, type SignTxnsResult, type SignerTransaction, type Siwa, type State, StorageAdapter, type SupportedWallet, type SupportedWallets, type WalletAccount, type WalletConfig, type WalletConfigMap, WalletConnect, type WalletConnectOptions, type WalletConstructor, WalletId, type WalletIdConfig, WalletManager, type WalletManagerConfig, type WalletManagerOptions, type WalletMap, type WalletMetadata, type WalletOptions, type WalletOptionsMap, type WalletState, type WalletTransaction, type WindowExtended, webpackFallback };
848
+ export { type AlgodConfig, BaseWallet, type BaseWalletConstructor, BiatecWallet, type CustomProvider, CustomWallet, type CustomWalletOptions, DEFAULT_NETWORK_CONFIG, DEFAULT_STATE, DEFLY_WEB_PROVIDER_ID, DeflyWallet, type DeflyWalletConnectOptions, DeflyWebWallet, type EnableResult, type Exodus, type ExodusOptions, ExodusWallet, ICON, type JsonRpcRequest, KIBISIS_AVM_WEB_PROVIDER_ID, KibisisWallet, type KmdOptions, KmdWallet, LOCAL_STORAGE_MNEMONIC_KEY, LiquidWallet, LogLevel, type LuteConnectOptions, LuteWallet, MagicAuth, type MagicAuthClient, type MagicAuthOptions, type ManagerStatus, type MnemonicOptions, MnemonicWallet, type MultisigMetadata, type NetworkConfig, NetworkConfigBuilder, NetworkId, PeraWallet, type PeraWalletConnectOptions, ScopeType, SessionError, type SignData, SignDataError, type SignDataResponse, type SignMetadata, SignTxnsError, type SignTxnsResponse, type SignTxnsResult, type SignerTransaction, type Siwa, type State, StorageAdapter, type SupportedWallet, type SupportedWallets, W3Wallet, type W3WalletProvider, type WalletAccount, type WalletConfig, type WalletConfigMap, WalletConnect, type WalletConnectOptions, type WalletConstructor, WalletId, type WalletIdConfig, WalletManager, type WalletManagerConfig, type WalletManagerOptions, type WalletMap, type WalletMetadata, type WalletOptions, type WalletOptionsMap, type WalletState, type WalletTransaction, type WindowExtended, webpackFallback };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import { Store } from '@tanstack/store';
2
- import algosdk from 'algosdk';
2
+ import algosdk, { Transaction } from 'algosdk';
3
3
  import AVMWebProviderSDK from '@agoralabs-sh/avm-web-provider';
4
+ import { LiquidAuthClient, LiquidOptions } from '@algorandfoundation/liquid-auth-use-wallet-client';
5
+ export { LiquidOptions } from '@algorandfoundation/liquid-auth-use-wallet-client';
4
6
  import { InstanceWithExtensions, SDKBase } from '@magic-sdk/provider';
5
7
  import { AlgorandExtension } from '@magic-ext/algorand';
6
8
  import { MagicUserMetadata } from 'magic-sdk';
@@ -183,6 +185,7 @@ declare abstract class AVMProvider extends BaseWallet {
183
185
  signTransactions<T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]): Promise<(Uint8Array | null)[]>;
184
186
  }
185
187
 
188
+ declare const DEFLY_WEB_PROVIDER_ID = "95426e60-5f2e-49e9-b912-c488577be962";
186
189
  declare class DeflyWebWallet extends AVMProvider {
187
190
  constructor({ id, store, subscribe, getAlgodClient, metadata }: WalletConstructor<WalletId.DEFLY_WEB>);
188
191
  static defaultMetadata: {
@@ -354,6 +357,22 @@ declare class KmdWallet extends BaseWallet {
354
357
  private fetchAccounts;
355
358
  }
356
359
 
360
+ declare class LiquidWallet extends BaseWallet {
361
+ protected store: Store<State>;
362
+ authClient: LiquidAuthClient | undefined | null;
363
+ private options;
364
+ constructor({ id, store, subscribe, getAlgodClient, options, metadata }: WalletConstructor<WalletId.LIQUID>);
365
+ static defaultMetadata: {
366
+ name: string;
367
+ icon: string;
368
+ };
369
+ private initializeClient;
370
+ connect: (_args?: Record<string, any>) => Promise<WalletAccount[]>;
371
+ disconnect: () => Promise<void>;
372
+ resumeSession: () => Promise<void>;
373
+ signTransactions: <T extends Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
374
+ }
375
+
357
376
  interface LuteConnectOptions {
358
377
  siteName?: string;
359
378
  }
@@ -505,6 +524,28 @@ declare class BiatecWallet extends WalletConnect {
505
524
  };
506
525
  }
507
526
 
527
+ interface W3WalletProvider {
528
+ isConnected: () => Promise<boolean>;
529
+ account: () => Promise<WalletAccount>;
530
+ signTxns: (transactions: WalletTransaction[]) => Promise<(string | null)[]>;
531
+ }
532
+ declare class W3Wallet extends BaseWallet {
533
+ private client;
534
+ protected store: Store<State>;
535
+ constructor({ id, store, subscribe, getAlgodClient, metadata }: WalletConstructor<WalletId.W3_WALLET>);
536
+ static defaultMetadata: {
537
+ name: string;
538
+ icon: string;
539
+ };
540
+ private initializeClient;
541
+ connect: () => Promise<WalletAccount[]>;
542
+ disconnect: () => Promise<void>;
543
+ resumeSession: () => Promise<void>;
544
+ private processTxns;
545
+ private processEncodedTxns;
546
+ signTransactions: <T extends algosdk.Transaction[] | Uint8Array[]>(txnGroup: T | T[], indexesToSign?: number[]) => Promise<(Uint8Array | null)[]>;
547
+ }
548
+
508
549
  declare enum WalletId {
509
550
  BIATEC = "biatec",
510
551
  DEFLY = "defly",
@@ -513,11 +554,13 @@ declare enum WalletId {
513
554
  EXODUS = "exodus",
514
555
  KIBISIS = "kibisis",
515
556
  KMD = "kmd",
557
+ LIQUID = "liquid",
516
558
  LUTE = "lute",
517
559
  MAGIC = "magic",
518
560
  MNEMONIC = "mnemonic",
519
561
  PERA = "pera",
520
- WALLETCONNECT = "walletconnect"
562
+ WALLETCONNECT = "walletconnect",
563
+ W3_WALLET = "w3-wallet"
521
564
  }
522
565
  type WalletMap = {
523
566
  [WalletId.BIATEC]: typeof BiatecWallet;
@@ -527,11 +570,13 @@ type WalletMap = {
527
570
  [WalletId.EXODUS]: typeof ExodusWallet;
528
571
  [WalletId.KIBISIS]: typeof KibisisWallet;
529
572
  [WalletId.KMD]: typeof KmdWallet;
573
+ [WalletId.LIQUID]: typeof LiquidWallet;
530
574
  [WalletId.LUTE]: typeof LuteWallet;
531
575
  [WalletId.MAGIC]: typeof MagicAuth;
532
576
  [WalletId.MNEMONIC]: typeof MnemonicWallet;
533
577
  [WalletId.PERA]: typeof PeraWallet;
534
578
  [WalletId.WALLETCONNECT]: typeof WalletConnect;
579
+ [WalletId.W3_WALLET]: typeof W3Wallet;
535
580
  };
536
581
  type WalletOptionsMap = {
537
582
  [WalletId.BIATEC]: WalletConnectOptions;
@@ -541,11 +586,13 @@ type WalletOptionsMap = {
541
586
  [WalletId.EXODUS]: ExodusOptions;
542
587
  [WalletId.KIBISIS]: Record<string, never>;
543
588
  [WalletId.KMD]: KmdOptions;
589
+ [WalletId.LIQUID]: LiquidOptions;
544
590
  [WalletId.LUTE]: LuteConnectOptions;
545
591
  [WalletId.MAGIC]: MagicAuthOptions;
546
592
  [WalletId.MNEMONIC]: MnemonicOptions;
547
593
  [WalletId.PERA]: PeraWalletConnectOptions;
548
594
  [WalletId.WALLETCONNECT]: WalletConnectOptions;
595
+ [WalletId.W3_WALLET]: Record<string, never>;
549
596
  };
550
597
  type SupportedWallet = WalletIdConfig<WalletId> | WalletId;
551
598
  type WalletConfigMap = {
@@ -788,6 +835,7 @@ declare class StorageAdapter {
788
835
  */
789
836
  declare const webpackFallback: {
790
837
  '@agoralabs-sh/avm-web-provider': boolean;
838
+ '@algorandfoundation/liquid-auth-use-wallet-client': boolean;
791
839
  '@blockshake/defly-connect': boolean;
792
840
  '@magic-ext/algorand': boolean;
793
841
  '@perawallet/connect': boolean;
@@ -797,4 +845,4 @@ declare const webpackFallback: {
797
845
  'magic-sdk': boolean;
798
846
  };
799
847
 
800
- export { type AlgodConfig, BaseWallet, type BaseWalletConstructor, type CustomProvider, CustomWallet, type CustomWalletOptions, DEFAULT_NETWORK_CONFIG, DEFAULT_STATE, DeflyWallet, type DeflyWalletConnectOptions, type EnableResult, type Exodus, type ExodusOptions, ExodusWallet, ICON, type JsonRpcRequest, KIBISIS_AVM_WEB_PROVIDER_ID, KibisisWallet, type KmdOptions, KmdWallet, LOCAL_STORAGE_MNEMONIC_KEY, LogLevel, MagicAuth, type MagicAuthClient, type MagicAuthOptions, type ManagerStatus, type MnemonicOptions, MnemonicWallet, type MultisigMetadata, type NetworkConfig, NetworkConfigBuilder, NetworkId, PeraWallet, type PeraWalletConnectOptions, ScopeType, SessionError, type SignData, SignDataError, type SignDataResponse, type SignMetadata, SignTxnsError, type SignTxnsResponse, type SignTxnsResult, type SignerTransaction, type Siwa, type State, StorageAdapter, type SupportedWallet, type SupportedWallets, type WalletAccount, type WalletConfig, type WalletConfigMap, WalletConnect, type WalletConnectOptions, type WalletConstructor, WalletId, type WalletIdConfig, WalletManager, type WalletManagerConfig, type WalletManagerOptions, type WalletMap, type WalletMetadata, type WalletOptions, type WalletOptionsMap, type WalletState, type WalletTransaction, type WindowExtended, webpackFallback };
848
+ export { type AlgodConfig, BaseWallet, type BaseWalletConstructor, BiatecWallet, type CustomProvider, CustomWallet, type CustomWalletOptions, DEFAULT_NETWORK_CONFIG, DEFAULT_STATE, DEFLY_WEB_PROVIDER_ID, DeflyWallet, type DeflyWalletConnectOptions, DeflyWebWallet, type EnableResult, type Exodus, type ExodusOptions, ExodusWallet, ICON, type JsonRpcRequest, KIBISIS_AVM_WEB_PROVIDER_ID, KibisisWallet, type KmdOptions, KmdWallet, LOCAL_STORAGE_MNEMONIC_KEY, LiquidWallet, LogLevel, type LuteConnectOptions, LuteWallet, MagicAuth, type MagicAuthClient, type MagicAuthOptions, type ManagerStatus, type MnemonicOptions, MnemonicWallet, type MultisigMetadata, type NetworkConfig, NetworkConfigBuilder, NetworkId, PeraWallet, type PeraWalletConnectOptions, ScopeType, SessionError, type SignData, SignDataError, type SignDataResponse, type SignMetadata, SignTxnsError, type SignTxnsResponse, type SignTxnsResult, type SignerTransaction, type Siwa, type State, StorageAdapter, type SupportedWallet, type SupportedWallets, W3Wallet, type W3WalletProvider, type WalletAccount, type WalletConfig, type WalletConfigMap, WalletConnect, type WalletConnectOptions, type WalletConstructor, WalletId, type WalletIdConfig, WalletManager, type WalletManagerConfig, type WalletManagerOptions, type WalletMap, type WalletMetadata, type WalletOptions, type WalletOptionsMap, type WalletState, type WalletTransaction, type WindowExtended, webpackFallback };