@txnlab/use-wallet 1.1.6 → 1.2.1
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/cjs/clients/algosigner/client.d.ts +2 -6
- package/dist/cjs/clients/base/base.d.ts +0 -1
- package/dist/cjs/clients/defly/client.d.ts +1 -6
- package/dist/cjs/clients/exodus/client.d.ts +1 -3
- package/dist/cjs/clients/index.d.ts +3 -2
- package/dist/cjs/clients/kmd/client.d.ts +2 -2
- package/dist/cjs/clients/mnemonic/client.d.ts +24 -0
- package/dist/cjs/clients/mnemonic/constants.d.ts +1 -0
- package/dist/cjs/clients/mnemonic/index.d.ts +2 -0
- package/dist/cjs/clients/mnemonic/types.d.ts +28 -0
- package/dist/cjs/clients/myalgo/client.d.ts +1 -3
- package/dist/cjs/clients/pera/client.d.ts +2 -6
- package/dist/cjs/clients/pera/types.d.ts +1 -6
- package/dist/cjs/clients/walletconnect/client.d.ts +2 -6
- package/dist/cjs/constants/constants.d.ts +2 -1
- package/dist/cjs/hooks/useWallet.d.ts +1 -12
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +174 -229
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/state/clientStore.d.ts +2 -0
- package/dist/cjs/utils/encodeNFDTransactionsArray.d.ts +2 -0
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/esm/clients/algosigner/client.d.ts +2 -6
- package/dist/esm/clients/base/base.d.ts +0 -1
- package/dist/esm/clients/defly/client.d.ts +1 -6
- package/dist/esm/clients/exodus/client.d.ts +1 -3
- package/dist/esm/clients/index.d.ts +3 -2
- package/dist/esm/clients/kmd/client.d.ts +2 -2
- package/dist/esm/clients/mnemonic/client.d.ts +24 -0
- package/dist/esm/clients/mnemonic/constants.d.ts +1 -0
- package/dist/esm/clients/mnemonic/index.d.ts +2 -0
- package/dist/esm/clients/mnemonic/types.d.ts +28 -0
- package/dist/esm/clients/myalgo/client.d.ts +1 -3
- package/dist/esm/clients/pera/client.d.ts +2 -6
- package/dist/esm/clients/pera/types.d.ts +1 -6
- package/dist/esm/clients/walletconnect/client.d.ts +2 -6
- package/dist/esm/constants/constants.d.ts +2 -1
- package/dist/esm/hooks/useWallet.d.ts +1 -12
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +173 -230
- package/dist/esm/store/state/clientStore.d.ts +2 -0
- package/dist/esm/utils/encodeNFDTransactionsArray.d.ts +2 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/index.d.ts +77 -91
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseWallet from "../base";
|
|
2
2
|
import { PROVIDER_ID } from "../../constants";
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { Network } from "../../types";
|
|
4
|
+
import type { AlgoSignerClientConstructor, InitParams } from "./types";
|
|
5
5
|
declare class AlgoSignerClient extends BaseWallet {
|
|
6
6
|
#private;
|
|
7
7
|
network: Network;
|
|
@@ -27,9 +27,5 @@ declare class AlgoSignerClient extends BaseWallet {
|
|
|
27
27
|
reconnect(onDisconnect: () => void): Promise<null>;
|
|
28
28
|
disconnect(): Promise<void>;
|
|
29
29
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
30
|
-
/** @deprecated */
|
|
31
|
-
formatTransactionsArray(transactions: TransactionsArray): AlgoSignerTransaction[];
|
|
32
|
-
/** @deprecated */
|
|
33
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
34
30
|
}
|
|
35
31
|
export default AlgoSignerClient;
|
|
@@ -10,7 +10,6 @@ declare abstract class BaseClient {
|
|
|
10
10
|
abstract disconnect(): Promise<void>;
|
|
11
11
|
abstract reconnect(onDisconnect: () => void): Promise<Wallet | null>;
|
|
12
12
|
abstract signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>, indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
13
|
-
abstract signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
14
13
|
protected constructor(metadata: Metadata, algosdk: typeof _algosdk, algodClient: _algosdk.Algodv2);
|
|
15
14
|
healthCheck(): Promise<{}>;
|
|
16
15
|
getAccountInfo(address: string): Promise<AccountInfo>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Wallet } from "../../types";
|
|
2
2
|
import { PROVIDER_ID } from "../../constants";
|
|
3
3
|
import BaseWallet from "../base";
|
|
4
|
-
import { TransactionsArray } from "../../types";
|
|
5
4
|
import type { Network } from "../../types";
|
|
6
|
-
import {
|
|
5
|
+
import { InitParams, DeflyWalletClientConstructor } from "./types";
|
|
7
6
|
declare class DeflyWalletClient extends BaseWallet {
|
|
8
7
|
#private;
|
|
9
8
|
network: Network;
|
|
@@ -29,9 +28,5 @@ declare class DeflyWalletClient extends BaseWallet {
|
|
|
29
28
|
} | null>;
|
|
30
29
|
disconnect(): Promise<void>;
|
|
31
30
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
32
|
-
/** @deprecated */
|
|
33
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
34
|
-
/** @deprecated */
|
|
35
|
-
formatTransactionsArray(transactions: TransactionsArray): DeflyTransaction[];
|
|
36
31
|
}
|
|
37
32
|
export default DeflyWalletClient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseWallet from "../base";
|
|
2
2
|
import { PROVIDER_ID } from "../../constants";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Network } from "../../types";
|
|
4
4
|
import { InitParams, ExodusClientConstructor } from "./types";
|
|
5
5
|
declare class ExodusClient extends BaseWallet {
|
|
6
6
|
#private;
|
|
@@ -27,7 +27,5 @@ declare class ExodusClient extends BaseWallet {
|
|
|
27
27
|
reconnect(onDisconnect: () => void): Promise<null>;
|
|
28
28
|
disconnect(): Promise<void>;
|
|
29
29
|
signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>, indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
30
|
-
/** @deprecated */
|
|
31
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
32
30
|
}
|
|
33
31
|
export default ExodusClient;
|
|
@@ -5,8 +5,9 @@ import exodus from "./exodus";
|
|
|
5
5
|
import algosigner from "./algosigner";
|
|
6
6
|
import walletconnect from "./walletconnect";
|
|
7
7
|
import kmd from "./kmd";
|
|
8
|
-
|
|
8
|
+
import mnemonic from "./mnemonic";
|
|
9
|
+
export { pera, myalgo, defly, exodus, algosigner, walletconnect, kmd, mnemonic, };
|
|
9
10
|
declare const _default: {
|
|
10
|
-
[x: string]: typeof pera | typeof myalgo | typeof defly | typeof exodus | typeof algosigner | typeof walletconnect | typeof kmd;
|
|
11
|
+
[x: string]: typeof pera | typeof myalgo | typeof defly | typeof exodus | typeof algosigner | typeof walletconnect | typeof kmd | typeof mnemonic;
|
|
11
12
|
};
|
|
12
13
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BaseWallet from "../base";
|
|
2
2
|
import { PROVIDER_ID } from "../../constants";
|
|
3
|
-
import type { Account, Wallet,
|
|
3
|
+
import type { Account, Wallet, Network } from "../../types";
|
|
4
4
|
import { InitParams, KMDWalletClientConstructor } from "./types";
|
|
5
5
|
declare class KMDWalletClient extends BaseWallet {
|
|
6
6
|
#private;
|
|
@@ -23,7 +23,7 @@ declare class KMDWalletClient extends BaseWallet {
|
|
|
23
23
|
releaseToken(token: string): Promise<void>;
|
|
24
24
|
listWallets(): Promise<Record<string, string>>;
|
|
25
25
|
listAccounts(wallet: string, password: string): Promise<Array<Account>>;
|
|
26
|
+
getWalletId(): Promise<string>;
|
|
26
27
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
27
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
28
28
|
}
|
|
29
29
|
export default KMDWalletClient;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import BaseWallet from "../base";
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import type { Wallet, TransactionsArray, Network } from "../../types";
|
|
4
|
+
import { InitParams, MnemonicWalletClientConstructor } from "./types";
|
|
5
|
+
declare class MnemonicWalletClient extends BaseWallet {
|
|
6
|
+
#private;
|
|
7
|
+
id: PROVIDER_ID;
|
|
8
|
+
network: Network;
|
|
9
|
+
constructor({ metadata, id, algosdk, algodClient, network, }: MnemonicWalletClientConstructor);
|
|
10
|
+
static metadata: {
|
|
11
|
+
id: PROVIDER_ID;
|
|
12
|
+
name: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
isWalletConnect: boolean;
|
|
15
|
+
};
|
|
16
|
+
static init({ algodOptions, algosdkStatic, network, }: InitParams): Promise<MnemonicWalletClient | null>;
|
|
17
|
+
connect(): Promise<Wallet>;
|
|
18
|
+
disconnect(): Promise<void>;
|
|
19
|
+
reconnect(): Promise<Wallet | null>;
|
|
20
|
+
requestPassword(): Promise<string>;
|
|
21
|
+
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
22
|
+
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
23
|
+
}
|
|
24
|
+
export default MnemonicWalletClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON = "data:image/svg+xml,%3c%3fxml version='1.0' encoding='UTF-8'%3f%3e %3c!-- Generated by Pixelmator Pro 3.2.2 --%3e %3csvg width='409' height='210' viewBox='0 0 409 210' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctext id='MNEMONIC' xml:space='preserve' x='0' y='129' font-family='Helvetica' font-size='72' fill='black'%3eMNEMONIC%3c/text%3e%3c/svg%3e";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type _algosdk from "algosdk";
|
|
2
|
+
import type { AlgodClientOptions, Network, Metadata } from "../../types";
|
|
3
|
+
import { PROVIDER_ID } from "../../constants";
|
|
4
|
+
export declare type ClientOptions = {
|
|
5
|
+
wallet: string;
|
|
6
|
+
password: string;
|
|
7
|
+
host: string;
|
|
8
|
+
token: string;
|
|
9
|
+
port: string;
|
|
10
|
+
};
|
|
11
|
+
export interface InitWalletHandle {
|
|
12
|
+
wallet_handle_token: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
error?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare type MnemonicWalletClientConstructor = {
|
|
17
|
+
metadata: Metadata;
|
|
18
|
+
id: PROVIDER_ID;
|
|
19
|
+
algosdk: typeof _algosdk;
|
|
20
|
+
algodClient: _algosdk.Algodv2;
|
|
21
|
+
network: Network;
|
|
22
|
+
};
|
|
23
|
+
export declare type InitParams = {
|
|
24
|
+
clientOptions?: ClientOptions;
|
|
25
|
+
algodOptions?: AlgodClientOptions;
|
|
26
|
+
algosdkStatic?: typeof _algosdk;
|
|
27
|
+
network?: Network;
|
|
28
|
+
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import BaseWallet from "../base";
|
|
6
6
|
import { PROVIDER_ID } from "../../constants";
|
|
7
|
-
import {
|
|
7
|
+
import { Network } from "../../types";
|
|
8
8
|
import { MyAlgoWalletClientConstructor, InitParams } from "./types";
|
|
9
9
|
declare class MyAlgoWalletClient extends BaseWallet {
|
|
10
10
|
#private;
|
|
@@ -31,7 +31,5 @@ declare class MyAlgoWalletClient extends BaseWallet {
|
|
|
31
31
|
reconnect(): Promise<null>;
|
|
32
32
|
disconnect(): Promise<void>;
|
|
33
33
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
34
|
-
/** @deprecated */
|
|
35
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
36
34
|
}
|
|
37
35
|
export default MyAlgoWalletClient;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Wallet,
|
|
1
|
+
import type { Wallet, Network } from "../../types";
|
|
2
2
|
import { PROVIDER_ID } from "../../constants";
|
|
3
3
|
import BaseWallet from "../base";
|
|
4
|
-
import {
|
|
4
|
+
import { PeraWalletClientConstructor, InitParams } from "./types";
|
|
5
5
|
declare class PeraWalletClient extends BaseWallet {
|
|
6
6
|
#private;
|
|
7
7
|
network: Network;
|
|
@@ -27,9 +27,5 @@ declare class PeraWalletClient extends BaseWallet {
|
|
|
27
27
|
} | null>;
|
|
28
28
|
disconnect(): Promise<void>;
|
|
29
29
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
30
|
-
/** @deprecated */
|
|
31
|
-
formatTransactionsArray(transactions: TransactionsArray): PeraTransaction[];
|
|
32
|
-
/** @deprecated */
|
|
33
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
34
30
|
}
|
|
35
31
|
export default PeraWalletClient;
|
|
@@ -4,13 +4,8 @@ import type { Transaction } from "algosdk";
|
|
|
4
4
|
import type { AlgodClientOptions, Network, Metadata } from "../../types";
|
|
5
5
|
export declare type ClientOptions = {
|
|
6
6
|
bridge?: string;
|
|
7
|
-
deep_link?: string;
|
|
8
|
-
app_meta?: {
|
|
9
|
-
logo: string;
|
|
10
|
-
name: string;
|
|
11
|
-
main_color: string;
|
|
12
|
-
};
|
|
13
7
|
shouldShowSignTxnToast?: boolean;
|
|
8
|
+
chainId?: 416001 | 416002 | 416003 | 4160;
|
|
14
9
|
};
|
|
15
10
|
export interface PeraTransaction {
|
|
16
11
|
txn: Transaction;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PROVIDER_ID } from "../../constants";
|
|
2
2
|
import BaseWallet from "../base";
|
|
3
|
-
import { Wallet,
|
|
4
|
-
import { WalletConnectClientConstructor, InitParams
|
|
3
|
+
import { Wallet, Network } from "../../types";
|
|
4
|
+
import { WalletConnectClientConstructor, InitParams } from "./types";
|
|
5
5
|
declare class WalletConnectClient extends BaseWallet {
|
|
6
6
|
#private;
|
|
7
7
|
network: Network;
|
|
@@ -28,9 +28,5 @@ declare class WalletConnectClient extends BaseWallet {
|
|
|
28
28
|
check(): boolean;
|
|
29
29
|
disconnect(): Promise<void>;
|
|
30
30
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
31
|
-
/** @deprecarted */
|
|
32
|
-
formatTransactionsArray(transactions: TransactionsArray): WalletConnectTransaction[];
|
|
33
|
-
/** @deprecated */
|
|
34
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
35
31
|
}
|
|
36
32
|
export default WalletConnectClient;
|
|
@@ -6,7 +6,8 @@ export declare enum PROVIDER_ID {
|
|
|
6
6
|
ALGOSIGNER = "algosigner",
|
|
7
7
|
DEFLY = "defly",
|
|
8
8
|
EXODUS = "exodus",
|
|
9
|
-
WALLETCONNECT = "walletconnect"
|
|
9
|
+
WALLETCONNECT = "walletconnect",
|
|
10
|
+
MNEMONIC = "mnemonic"
|
|
10
11
|
}
|
|
11
12
|
export declare const DEFAULT_NETWORK: Network;
|
|
12
13
|
export declare const DEFAULT_NODE_BASEURL = "https://mainnet-api.algonode.cloud";
|
|
@@ -10,6 +10,7 @@ export default function useWallet(): {
|
|
|
10
10
|
defly: Promise<import("../clients/base/base").default | null>;
|
|
11
11
|
exodus: Promise<import("../clients/base/base").default | null>;
|
|
12
12
|
walletconnect: Promise<import("../clients/base/base").default | null>;
|
|
13
|
+
mnemonic: Promise<import("../clients/base/base").default | null>;
|
|
13
14
|
}> | null;
|
|
14
15
|
providers: Provider[] | null;
|
|
15
16
|
connectedAccounts: import("../types").Account[];
|
|
@@ -36,16 +37,4 @@ export default function useWallet(): {
|
|
|
36
37
|
groupTransactionsBySender: (transactions: TransactionsArray) => Promise<Record<string, any>>;
|
|
37
38
|
getAccountInfo: () => Promise<import("../types").AccountInfo>;
|
|
38
39
|
getAssets: () => Promise<import("../types").Asset[]>;
|
|
39
|
-
signEncodedTransactions: (transactions: TransactionsArray) => Promise<Uint8Array[]>;
|
|
40
|
-
sendRawTransactions: (transactions: Uint8Array[], waitRoundsToConfirm?: number) => Promise<{
|
|
41
|
-
"confirmed-round": number;
|
|
42
|
-
"global-state-delta": Record<string, unknown>[];
|
|
43
|
-
"pool-error": string;
|
|
44
|
-
txn: {
|
|
45
|
-
sig: Uint8Array;
|
|
46
|
-
txn: import("../types").Txn;
|
|
47
|
-
};
|
|
48
|
-
txId: string;
|
|
49
|
-
id: any;
|
|
50
|
-
}>;
|
|
51
40
|
};
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { useWallet } from "./hooks";
|
|
2
|
-
export { initializeProviders, reconnectProviders } from "./utils";
|
|
2
|
+
export { initializeProviders, reconnectProviders, encodeNFDTransactionsArray, } from "./utils";
|
|
3
3
|
export { WalletProvider } from "./store";
|
|
4
4
|
export * from "./constants";
|
|
5
5
|
export * from "./types";
|