@d13co/use-wallet 4.5.10 → 4.5.12
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.cjs +2669 -2213
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -21
- package/dist/index.d.ts +21 -21
- package/dist/index.js +2672 -2216
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { InstanceWithExtensions, SDKBase } from '@magic-sdk/provider';
|
|
|
5
5
|
import { AlgorandExtension } from '@magic-ext/algorand';
|
|
6
6
|
import { MagicUserMetadata } from 'magic-sdk';
|
|
7
7
|
import { AlgorandClient } from '@algorandfoundation/algokit-utils';
|
|
8
|
-
import {
|
|
8
|
+
import { AlgoXEvmSdk, SignTypedDataParams } from 'algo-x-evm-sdk';
|
|
9
9
|
import { Config } from '@wagmi/core';
|
|
10
10
|
import { WalletConnectModalConfig } from '@walletconnect/modal';
|
|
11
11
|
import { SignClientTypes } from '@walletconnect/types';
|
|
@@ -473,7 +473,7 @@ interface EvmAccount {
|
|
|
473
473
|
evmAddress: string;
|
|
474
474
|
algorandAddress: string;
|
|
475
475
|
}
|
|
476
|
-
interface
|
|
476
|
+
interface AlgoXEvmOptions {
|
|
477
477
|
uiHooks?: {
|
|
478
478
|
onConnect?: (evmAccount: EvmAccount) => void;
|
|
479
479
|
onBeforeSign?: (txnGroup: algosdk.Transaction[] | Uint8Array[], indexesToSign?: number[]) => Promise<void>;
|
|
@@ -481,11 +481,11 @@ interface LiquidEvmOptions {
|
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
483
|
/**
|
|
484
|
-
* Abstract base class for EVM-based wallets that use the
|
|
484
|
+
* Abstract base class for EVM-based wallets that use the Algo x EVM system
|
|
485
485
|
* to derive Algorand addresses from EVM addresses.
|
|
486
486
|
*
|
|
487
487
|
* This class provides common functionality for:
|
|
488
|
-
* - Initializing the
|
|
488
|
+
* - Initializing the Algo x EVM SDK
|
|
489
489
|
* - Deriving Algorand accounts from EVM addresses
|
|
490
490
|
* - Signing Algorand transactions using EVM signatures
|
|
491
491
|
* - Managing the mapping between EVM and Algorand addresses
|
|
@@ -495,22 +495,22 @@ interface LiquidEvmOptions {
|
|
|
495
495
|
* - getEvmProvider(): Get the EVM provider instance
|
|
496
496
|
* - signWithProvider(): Sign a message with the specific EVM wallet
|
|
497
497
|
*/
|
|
498
|
-
declare abstract class
|
|
499
|
-
protected
|
|
498
|
+
declare abstract class AlgoXEvmBaseWallet extends BaseWallet {
|
|
499
|
+
protected algoXEvmSdk: AlgoXEvmSdk | null;
|
|
500
500
|
protected algorandClient: AlgorandClient | null;
|
|
501
501
|
protected evmAddressMap: Map<string, string>;
|
|
502
|
-
protected options:
|
|
502
|
+
protected options: AlgoXEvmOptions;
|
|
503
503
|
protected store: Store<State>;
|
|
504
504
|
constructor(params: WalletConstructor<any>);
|
|
505
505
|
/**
|
|
506
|
-
* Default metadata for
|
|
507
|
-
* Subclasses MUST override this with their own metadata including
|
|
506
|
+
* Default metadata for Algo x EVM wallets.
|
|
507
|
+
* Subclasses MUST override this with their own metadata including isAlgoXEvm: "EVM"
|
|
508
508
|
*/
|
|
509
|
-
static defaultMetadata:
|
|
509
|
+
static defaultMetadata: AlgoXEvmMetadata;
|
|
510
510
|
/**
|
|
511
|
-
* Typed metadata accessor that guarantees
|
|
511
|
+
* Typed metadata accessor that guarantees isAlgoXEvm: "EVM" is present
|
|
512
512
|
*/
|
|
513
|
-
readonly metadata:
|
|
513
|
+
readonly metadata: AlgoXEvmMetadata;
|
|
514
514
|
/**
|
|
515
515
|
* Initialize the provider-specific SDK or connection.
|
|
516
516
|
* Called during connect/resume to set up the wallet.
|
|
@@ -530,9 +530,9 @@ declare abstract class LiquidEvmBaseWallet extends BaseWallet {
|
|
|
530
530
|
*/
|
|
531
531
|
protected abstract signWithProvider(typedData: SignTypedDataParams, evmAddress: string): Promise<string>;
|
|
532
532
|
/**
|
|
533
|
-
* Initialize the
|
|
533
|
+
* Initialize the Algo x EVM SDK for deriving Algorand addresses
|
|
534
534
|
*/
|
|
535
|
-
protected initializeEvmSdk(): Promise<
|
|
535
|
+
protected initializeEvmSdk(): Promise<AlgoXEvmSdk>;
|
|
536
536
|
/**
|
|
537
537
|
* Derive Algorand accounts from EVM addresses.
|
|
538
538
|
* @param evmAddresses - EVM addresses to derive Algorand accounts from
|
|
@@ -561,7 +561,7 @@ declare abstract class LiquidEvmBaseWallet extends BaseWallet {
|
|
|
561
561
|
protected notifyConnect(evmAddress: string, algorandAddress: string): void;
|
|
562
562
|
}
|
|
563
563
|
|
|
564
|
-
interface RainbowKitWalletOptions extends
|
|
564
|
+
interface RainbowKitWalletOptions extends AlgoXEvmOptions {
|
|
565
565
|
/** wagmi Config instance, typically created with RainbowKit's getDefaultConfig() */
|
|
566
566
|
wagmiConfig: Config;
|
|
567
567
|
/**
|
|
@@ -571,7 +571,7 @@ interface RainbowKitWalletOptions extends LiquidEvmOptions {
|
|
|
571
571
|
*/
|
|
572
572
|
getEvmAccounts?: () => Promise<string[]>;
|
|
573
573
|
}
|
|
574
|
-
declare class RainbowKitWallet extends
|
|
574
|
+
declare class RainbowKitWallet extends AlgoXEvmBaseWallet {
|
|
575
575
|
protected options: RainbowKitWalletOptions;
|
|
576
576
|
private _connecting;
|
|
577
577
|
private _disconnecting;
|
|
@@ -581,7 +581,7 @@ declare class RainbowKitWallet extends LiquidEvmBaseWallet {
|
|
|
581
581
|
static defaultMetadata: {
|
|
582
582
|
name: string;
|
|
583
583
|
icon: string;
|
|
584
|
-
|
|
584
|
+
isAlgoXEvm: "EVM";
|
|
585
585
|
};
|
|
586
586
|
/** True while connect() is running. Prevents re-entrancy from bridge components. */
|
|
587
587
|
get isConnecting(): boolean;
|
|
@@ -1066,10 +1066,10 @@ type SupportedWallets = NonEmptyArray<SupportedWallet>;
|
|
|
1066
1066
|
type WalletMetadata = {
|
|
1067
1067
|
name: string;
|
|
1068
1068
|
icon: string;
|
|
1069
|
-
|
|
1069
|
+
isAlgoXEvm?: 'EVM';
|
|
1070
1070
|
};
|
|
1071
|
-
type
|
|
1072
|
-
|
|
1071
|
+
type AlgoXEvmMetadata = WalletMetadata & {
|
|
1072
|
+
isAlgoXEvm: 'EVM';
|
|
1073
1073
|
};
|
|
1074
1074
|
interface UIHooks {
|
|
1075
1075
|
onBeforeSign?: (txnGroup: algosdk.Transaction[] | Uint8Array[], indexesToSign?: number[]) => Promise<void>;
|
|
@@ -1433,4 +1433,4 @@ declare function getSkin(skinId: string): WalletConnectSkin | undefined;
|
|
|
1433
1433
|
*/
|
|
1434
1434
|
declare function resolveSkin(skinOption: WalletConnectSkinOption): WalletConnectSkin | undefined;
|
|
1435
1435
|
|
|
1436
|
-
export { type AlgodConfig, BUILTIN_SKINS, 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,
|
|
1436
|
+
export { AlgoXEvmBaseWallet, type AlgoXEvmMetadata, type AlgoXEvmOptions, type AlgodConfig, BUILTIN_SKINS, 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, LogLevel, type LuteConnectOptions, LuteWallet, MagicAuth, type MagicAuthClient, type MagicAuthOptions, type ManagerStatus, type MnemonicOptions, MnemonicWallet, type MultisigMetadata, type NetworkConfig, NetworkConfigBuilder, NetworkId, PeraWallet, type PeraWalletConnectOptions, RainbowKitWallet, type RainbowKitWalletOptions, ScopeType, SecureKeyContainer, 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 UIHooks, W3Wallet, type W3WalletProvider, type WalletAccount, type WalletConfig, type WalletConfigMap, WalletConnect, type WalletConnectOptions, type WalletConnectSkin, type WalletConnectSkinOption, type WalletConstructor, WalletId, type WalletIdConfig, type WalletKey, WalletManager, type WalletManagerConfig, type WalletManagerOptions, type WalletMap, type WalletMetadata, type WalletOptions, type WalletOptionsMap, type WalletState, type WalletTransaction, type Web3AuthCredentials, type Web3AuthCustomAuth, type Web3AuthOptions, Web3AuthWallet, type WindowExtended, getSkin, registerSkin, resolveSkin, webpackFallback, withSecureKey, withSecureKeySync, zeroMemory, zeroString };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { InstanceWithExtensions, SDKBase } from '@magic-sdk/provider';
|
|
|
5
5
|
import { AlgorandExtension } from '@magic-ext/algorand';
|
|
6
6
|
import { MagicUserMetadata } from 'magic-sdk';
|
|
7
7
|
import { AlgorandClient } from '@algorandfoundation/algokit-utils';
|
|
8
|
-
import {
|
|
8
|
+
import { AlgoXEvmSdk, SignTypedDataParams } from 'algo-x-evm-sdk';
|
|
9
9
|
import { Config } from '@wagmi/core';
|
|
10
10
|
import { WalletConnectModalConfig } from '@walletconnect/modal';
|
|
11
11
|
import { SignClientTypes } from '@walletconnect/types';
|
|
@@ -473,7 +473,7 @@ interface EvmAccount {
|
|
|
473
473
|
evmAddress: string;
|
|
474
474
|
algorandAddress: string;
|
|
475
475
|
}
|
|
476
|
-
interface
|
|
476
|
+
interface AlgoXEvmOptions {
|
|
477
477
|
uiHooks?: {
|
|
478
478
|
onConnect?: (evmAccount: EvmAccount) => void;
|
|
479
479
|
onBeforeSign?: (txnGroup: algosdk.Transaction[] | Uint8Array[], indexesToSign?: number[]) => Promise<void>;
|
|
@@ -481,11 +481,11 @@ interface LiquidEvmOptions {
|
|
|
481
481
|
};
|
|
482
482
|
}
|
|
483
483
|
/**
|
|
484
|
-
* Abstract base class for EVM-based wallets that use the
|
|
484
|
+
* Abstract base class for EVM-based wallets that use the Algo x EVM system
|
|
485
485
|
* to derive Algorand addresses from EVM addresses.
|
|
486
486
|
*
|
|
487
487
|
* This class provides common functionality for:
|
|
488
|
-
* - Initializing the
|
|
488
|
+
* - Initializing the Algo x EVM SDK
|
|
489
489
|
* - Deriving Algorand accounts from EVM addresses
|
|
490
490
|
* - Signing Algorand transactions using EVM signatures
|
|
491
491
|
* - Managing the mapping between EVM and Algorand addresses
|
|
@@ -495,22 +495,22 @@ interface LiquidEvmOptions {
|
|
|
495
495
|
* - getEvmProvider(): Get the EVM provider instance
|
|
496
496
|
* - signWithProvider(): Sign a message with the specific EVM wallet
|
|
497
497
|
*/
|
|
498
|
-
declare abstract class
|
|
499
|
-
protected
|
|
498
|
+
declare abstract class AlgoXEvmBaseWallet extends BaseWallet {
|
|
499
|
+
protected algoXEvmSdk: AlgoXEvmSdk | null;
|
|
500
500
|
protected algorandClient: AlgorandClient | null;
|
|
501
501
|
protected evmAddressMap: Map<string, string>;
|
|
502
|
-
protected options:
|
|
502
|
+
protected options: AlgoXEvmOptions;
|
|
503
503
|
protected store: Store<State>;
|
|
504
504
|
constructor(params: WalletConstructor<any>);
|
|
505
505
|
/**
|
|
506
|
-
* Default metadata for
|
|
507
|
-
* Subclasses MUST override this with their own metadata including
|
|
506
|
+
* Default metadata for Algo x EVM wallets.
|
|
507
|
+
* Subclasses MUST override this with their own metadata including isAlgoXEvm: "EVM"
|
|
508
508
|
*/
|
|
509
|
-
static defaultMetadata:
|
|
509
|
+
static defaultMetadata: AlgoXEvmMetadata;
|
|
510
510
|
/**
|
|
511
|
-
* Typed metadata accessor that guarantees
|
|
511
|
+
* Typed metadata accessor that guarantees isAlgoXEvm: "EVM" is present
|
|
512
512
|
*/
|
|
513
|
-
readonly metadata:
|
|
513
|
+
readonly metadata: AlgoXEvmMetadata;
|
|
514
514
|
/**
|
|
515
515
|
* Initialize the provider-specific SDK or connection.
|
|
516
516
|
* Called during connect/resume to set up the wallet.
|
|
@@ -530,9 +530,9 @@ declare abstract class LiquidEvmBaseWallet extends BaseWallet {
|
|
|
530
530
|
*/
|
|
531
531
|
protected abstract signWithProvider(typedData: SignTypedDataParams, evmAddress: string): Promise<string>;
|
|
532
532
|
/**
|
|
533
|
-
* Initialize the
|
|
533
|
+
* Initialize the Algo x EVM SDK for deriving Algorand addresses
|
|
534
534
|
*/
|
|
535
|
-
protected initializeEvmSdk(): Promise<
|
|
535
|
+
protected initializeEvmSdk(): Promise<AlgoXEvmSdk>;
|
|
536
536
|
/**
|
|
537
537
|
* Derive Algorand accounts from EVM addresses.
|
|
538
538
|
* @param evmAddresses - EVM addresses to derive Algorand accounts from
|
|
@@ -561,7 +561,7 @@ declare abstract class LiquidEvmBaseWallet extends BaseWallet {
|
|
|
561
561
|
protected notifyConnect(evmAddress: string, algorandAddress: string): void;
|
|
562
562
|
}
|
|
563
563
|
|
|
564
|
-
interface RainbowKitWalletOptions extends
|
|
564
|
+
interface RainbowKitWalletOptions extends AlgoXEvmOptions {
|
|
565
565
|
/** wagmi Config instance, typically created with RainbowKit's getDefaultConfig() */
|
|
566
566
|
wagmiConfig: Config;
|
|
567
567
|
/**
|
|
@@ -571,7 +571,7 @@ interface RainbowKitWalletOptions extends LiquidEvmOptions {
|
|
|
571
571
|
*/
|
|
572
572
|
getEvmAccounts?: () => Promise<string[]>;
|
|
573
573
|
}
|
|
574
|
-
declare class RainbowKitWallet extends
|
|
574
|
+
declare class RainbowKitWallet extends AlgoXEvmBaseWallet {
|
|
575
575
|
protected options: RainbowKitWalletOptions;
|
|
576
576
|
private _connecting;
|
|
577
577
|
private _disconnecting;
|
|
@@ -581,7 +581,7 @@ declare class RainbowKitWallet extends LiquidEvmBaseWallet {
|
|
|
581
581
|
static defaultMetadata: {
|
|
582
582
|
name: string;
|
|
583
583
|
icon: string;
|
|
584
|
-
|
|
584
|
+
isAlgoXEvm: "EVM";
|
|
585
585
|
};
|
|
586
586
|
/** True while connect() is running. Prevents re-entrancy from bridge components. */
|
|
587
587
|
get isConnecting(): boolean;
|
|
@@ -1066,10 +1066,10 @@ type SupportedWallets = NonEmptyArray<SupportedWallet>;
|
|
|
1066
1066
|
type WalletMetadata = {
|
|
1067
1067
|
name: string;
|
|
1068
1068
|
icon: string;
|
|
1069
|
-
|
|
1069
|
+
isAlgoXEvm?: 'EVM';
|
|
1070
1070
|
};
|
|
1071
|
-
type
|
|
1072
|
-
|
|
1071
|
+
type AlgoXEvmMetadata = WalletMetadata & {
|
|
1072
|
+
isAlgoXEvm: 'EVM';
|
|
1073
1073
|
};
|
|
1074
1074
|
interface UIHooks {
|
|
1075
1075
|
onBeforeSign?: (txnGroup: algosdk.Transaction[] | Uint8Array[], indexesToSign?: number[]) => Promise<void>;
|
|
@@ -1433,4 +1433,4 @@ declare function getSkin(skinId: string): WalletConnectSkin | undefined;
|
|
|
1433
1433
|
*/
|
|
1434
1434
|
declare function resolveSkin(skinOption: WalletConnectSkinOption): WalletConnectSkin | undefined;
|
|
1435
1435
|
|
|
1436
|
-
export { type AlgodConfig, BUILTIN_SKINS, 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,
|
|
1436
|
+
export { AlgoXEvmBaseWallet, type AlgoXEvmMetadata, type AlgoXEvmOptions, type AlgodConfig, BUILTIN_SKINS, 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, LogLevel, type LuteConnectOptions, LuteWallet, MagicAuth, type MagicAuthClient, type MagicAuthOptions, type ManagerStatus, type MnemonicOptions, MnemonicWallet, type MultisigMetadata, type NetworkConfig, NetworkConfigBuilder, NetworkId, PeraWallet, type PeraWalletConnectOptions, RainbowKitWallet, type RainbowKitWalletOptions, ScopeType, SecureKeyContainer, 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 UIHooks, W3Wallet, type W3WalletProvider, type WalletAccount, type WalletConfig, type WalletConfigMap, WalletConnect, type WalletConnectOptions, type WalletConnectSkin, type WalletConnectSkinOption, type WalletConstructor, WalletId, type WalletIdConfig, type WalletKey, WalletManager, type WalletManagerConfig, type WalletManagerOptions, type WalletMap, type WalletMetadata, type WalletOptions, type WalletOptionsMap, type WalletState, type WalletTransaction, type Web3AuthCredentials, type Web3AuthCustomAuth, type Web3AuthOptions, Web3AuthWallet, type WindowExtended, getSkin, registerSkin, resolveSkin, webpackFallback, withSecureKey, withSecureKeySync, zeroMemory, zeroString };
|