@txnlab/use-wallet 0.1.23 → 1.0.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/README.md +255 -95
- package/dist/cjs/algod/index.d.ts +3 -2
- package/dist/cjs/clients/algosigner/client.d.ts +35 -0
- package/dist/cjs/clients/algosigner/constants.d.ts +2 -0
- package/dist/cjs/clients/algosigner/index.d.ts +2 -0
- package/dist/cjs/clients/algosigner/types.d.ts +40 -0
- package/dist/{esm/clients → cjs/clients/base}/base.d.ts +12 -25
- package/dist/cjs/clients/base/index.d.ts +2 -0
- package/dist/cjs/clients/defly/client.d.ts +37 -0
- package/dist/cjs/clients/defly/constants.d.ts +1 -0
- package/dist/cjs/clients/defly/index.d.ts +2 -0
- package/dist/cjs/clients/defly/types.d.ts +36 -0
- package/dist/cjs/clients/exodus/client.d.ts +33 -0
- package/dist/cjs/clients/exodus/constants.d.ts +1 -0
- package/dist/cjs/clients/exodus/index.d.ts +2 -0
- package/dist/cjs/clients/exodus/types.d.ts +40 -0
- package/dist/cjs/clients/index.d.ts +11 -15
- package/dist/cjs/clients/kmd/client.d.ts +29 -0
- package/dist/cjs/clients/kmd/constants.d.ts +1 -0
- package/dist/cjs/clients/kmd/index.d.ts +2 -0
- package/dist/cjs/clients/kmd/types.d.ts +38 -0
- package/dist/cjs/clients/{myalgowallet.d.ts → myalgo/client.d.ts} +14 -17
- package/dist/cjs/clients/myalgo/constants.d.ts +1 -0
- package/dist/cjs/clients/myalgo/index.d.ts +2 -0
- package/dist/cjs/clients/myalgo/types.d.ts +23 -0
- package/dist/cjs/clients/pera/client.d.ts +35 -0
- package/dist/cjs/clients/pera/constants.d.ts +1 -0
- package/dist/cjs/clients/pera/index.d.ts +2 -0
- package/dist/cjs/clients/pera/types.d.ts +36 -0
- package/dist/cjs/clients/walletconnect/client.d.ts +37 -0
- package/dist/cjs/clients/walletconnect/constants.d.ts +2 -0
- package/dist/cjs/clients/walletconnect/index.d.ts +2 -0
- package/dist/cjs/clients/walletconnect/types.d.ts +54 -0
- package/dist/cjs/constants/constants.d.ts +12 -16
- package/dist/cjs/hooks/index.d.ts +0 -1
- package/dist/cjs/hooks/useWallet.d.ts +140 -8
- package/dist/cjs/index.d.ts +4 -2
- package/dist/cjs/index.js +736 -739
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/index.d.ts +1 -0
- package/dist/cjs/store/state/clientStore.d.ts +22 -0
- package/dist/cjs/types/node.d.ts +3 -0
- package/dist/cjs/types/wallet.d.ts +2 -2
- package/dist/cjs/utils/index.d.ts +2 -2
- package/dist/cjs/utils/initializeProviders.d.ts +13 -0
- package/dist/cjs/utils/reconnectProviders.d.ts +6 -0
- package/dist/esm/algod/index.d.ts +3 -2
- package/dist/esm/clients/algosigner/client.d.ts +35 -0
- package/dist/esm/clients/algosigner/constants.d.ts +2 -0
- package/dist/esm/clients/algosigner/index.d.ts +2 -0
- package/dist/esm/clients/algosigner/types.d.ts +40 -0
- package/dist/{cjs/clients → esm/clients/base}/base.d.ts +12 -25
- package/dist/esm/clients/base/index.d.ts +2 -0
- package/dist/esm/clients/defly/client.d.ts +37 -0
- package/dist/esm/clients/defly/constants.d.ts +1 -0
- package/dist/esm/clients/defly/index.d.ts +2 -0
- package/dist/esm/clients/defly/types.d.ts +36 -0
- package/dist/esm/clients/exodus/client.d.ts +33 -0
- package/dist/esm/clients/exodus/constants.d.ts +1 -0
- package/dist/esm/clients/exodus/index.d.ts +2 -0
- package/dist/esm/clients/exodus/types.d.ts +40 -0
- package/dist/esm/clients/index.d.ts +11 -15
- package/dist/esm/clients/kmd/client.d.ts +29 -0
- package/dist/esm/clients/kmd/constants.d.ts +1 -0
- package/dist/esm/clients/kmd/index.d.ts +2 -0
- package/dist/esm/clients/kmd/types.d.ts +38 -0
- package/dist/esm/clients/{myalgowallet.d.ts → myalgo/client.d.ts} +14 -17
- package/dist/esm/clients/myalgo/constants.d.ts +1 -0
- package/dist/esm/clients/myalgo/index.d.ts +2 -0
- package/dist/esm/clients/myalgo/types.d.ts +23 -0
- package/dist/esm/clients/pera/client.d.ts +35 -0
- package/dist/esm/clients/pera/constants.d.ts +1 -0
- package/dist/esm/clients/pera/index.d.ts +2 -0
- package/dist/esm/clients/pera/types.d.ts +36 -0
- package/dist/esm/clients/walletconnect/client.d.ts +37 -0
- package/dist/esm/clients/walletconnect/constants.d.ts +2 -0
- package/dist/esm/clients/walletconnect/index.d.ts +2 -0
- package/dist/esm/clients/walletconnect/types.d.ts +54 -0
- package/dist/esm/constants/constants.d.ts +12 -16
- package/dist/esm/hooks/index.d.ts +0 -1
- package/dist/esm/hooks/useWallet.d.ts +140 -8
- package/dist/esm/index.d.ts +4 -2
- package/dist/esm/index.js +724 -730
- package/dist/esm/store/index.d.ts +1 -0
- package/dist/esm/store/state/clientStore.d.ts +22 -0
- package/dist/esm/types/node.d.ts +3 -0
- package/dist/esm/types/wallet.d.ts +2 -2
- package/dist/esm/utils/index.d.ts +2 -2
- package/dist/esm/utils/initializeProviders.d.ts +13 -0
- package/dist/esm/utils/reconnectProviders.d.ts +6 -0
- package/dist/index.d.ts +669 -66
- package/package.json +6 -6
- package/dist/cjs/clients/algosigner.d.ts +0 -62
- package/dist/cjs/clients/defly.d.ts +0 -51
- package/dist/cjs/clients/exodus.d.ts +0 -52
- package/dist/cjs/clients/kmd.d.ts +0 -31
- package/dist/cjs/clients/perawallet.d.ts +0 -47
- package/dist/cjs/clients/walletconnect.d.ts +0 -47
- package/dist/cjs/hooks/useConnectWallet.d.ts +0 -30
- package/dist/cjs/providers/algosigner.d.ts +0 -2
- package/dist/cjs/providers/defly.d.ts +0 -2
- package/dist/cjs/providers/exodus.d.ts +0 -2
- package/dist/cjs/providers/index.d.ts +0 -9
- package/dist/cjs/providers/kmd.d.ts +0 -2
- package/dist/cjs/providers/myalgowallet.d.ts +0 -2
- package/dist/cjs/providers/perawallet.d.ts +0 -2
- package/dist/cjs/providers/walletconnect.d.ts +0 -2
- package/dist/esm/clients/algosigner.d.ts +0 -62
- package/dist/esm/clients/defly.d.ts +0 -51
- package/dist/esm/clients/exodus.d.ts +0 -52
- package/dist/esm/clients/kmd.d.ts +0 -31
- package/dist/esm/clients/perawallet.d.ts +0 -47
- package/dist/esm/clients/walletconnect.d.ts +0 -47
- package/dist/esm/hooks/useConnectWallet.d.ts +0 -30
- package/dist/esm/providers/algosigner.d.ts +0 -2
- package/dist/esm/providers/defly.d.ts +0 -2
- package/dist/esm/providers/exodus.d.ts +0 -2
- package/dist/esm/providers/index.d.ts +0 -9
- package/dist/esm/providers/kmd.d.ts +0 -2
- package/dist/esm/providers/myalgowallet.d.ts +0 -2
- package/dist/esm/providers/perawallet.d.ts +0 -2
- package/dist/esm/providers/walletconnect.d.ts +0 -2
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import BaseWallet from "../../clients/base";
|
|
3
|
+
declare const ClientContext: import("react").Context<Partial<{
|
|
4
|
+
kmd: Promise<BaseWallet | null>;
|
|
5
|
+
pera: Promise<BaseWallet | null>;
|
|
6
|
+
myalgo: Promise<BaseWallet | null>;
|
|
7
|
+
algosigner: Promise<BaseWallet | null>;
|
|
8
|
+
defly: Promise<BaseWallet | null>;
|
|
9
|
+
exodus: Promise<BaseWallet | null>;
|
|
10
|
+
walletconnect: Promise<BaseWallet | null>;
|
|
11
|
+
}> | null>;
|
|
12
|
+
export { ClientContext };
|
|
13
|
+
declare const _default: import("react").Provider<Partial<{
|
|
14
|
+
kmd: Promise<BaseWallet | null>;
|
|
15
|
+
pera: Promise<BaseWallet | null>;
|
|
16
|
+
myalgo: Promise<BaseWallet | null>;
|
|
17
|
+
algosigner: Promise<BaseWallet | null>;
|
|
18
|
+
defly: Promise<BaseWallet | null>;
|
|
19
|
+
exodus: Promise<BaseWallet | null>;
|
|
20
|
+
walletconnect: Promise<BaseWallet | null>;
|
|
21
|
+
}> | null>;
|
|
22
|
+
export default _default;
|
package/dist/cjs/types/node.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type algosdk from "algosdk";
|
|
2
|
+
export declare type Network = "betanet" | "testnet" | "mainnet" | string;
|
|
1
3
|
export declare type Txn = {
|
|
2
4
|
apaa: Uint8Array;
|
|
3
5
|
apas: number[];
|
|
@@ -38,3 +40,4 @@ export declare type DecodedSignedTransaction = {
|
|
|
38
40
|
sig: Uint8Array;
|
|
39
41
|
txn: DecodedTransaction;
|
|
40
42
|
};
|
|
43
|
+
export declare type AlgodClientOptions = ConstructorParameters<typeof algosdk.Algodv2>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PROVIDER_ID } from "../constants";
|
|
2
|
-
import type
|
|
2
|
+
import type BaseWallet from "../clients/base";
|
|
3
3
|
export interface Account {
|
|
4
4
|
providerId: PROVIDER_ID;
|
|
5
5
|
name: string;
|
|
@@ -43,5 +43,5 @@ declare type ExtendValues<Type> = {
|
|
|
43
43
|
export declare type Wallet = ExtendValues<WalletProvider> & {
|
|
44
44
|
accounts: Account[];
|
|
45
45
|
};
|
|
46
|
-
export declare type WalletClient =
|
|
46
|
+
export declare type WalletClient = BaseWallet;
|
|
47
47
|
export { PROVIDER_ID };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
export { initializeProviders } from "./initializeProviders";
|
|
2
|
+
export { reconnectProviders } from "./reconnectProviders";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type algosdk from "algosdk";
|
|
2
|
+
import { PROVIDER_ID, WalletClient, Network } from "../types";
|
|
3
|
+
declare type SupportedProviders = {
|
|
4
|
+
[x: string]: Promise<WalletClient | null>;
|
|
5
|
+
};
|
|
6
|
+
declare type NodeConfig = {
|
|
7
|
+
network: Network;
|
|
8
|
+
nodeServer: string;
|
|
9
|
+
nodeToken?: string;
|
|
10
|
+
nodePort?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const initializeProviders: (providers?: PROVIDER_ID[], nodeConfig?: NodeConfig, algosdkStatic?: typeof algosdk) => SupportedProviders;
|
|
13
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type _algosdk from "algosdk";
|
|
2
|
+
import type { AlgodClientOptions } from "../types";
|
|
2
3
|
export declare const getAlgosdk: () => Promise<typeof _algosdk>;
|
|
3
|
-
export declare const getAlgodClient: (algosdk: typeof _algosdk) => Promise<_algosdk.Algodv2>;
|
|
4
|
+
export declare const getAlgodClient: (algosdk: typeof _algosdk, algodClientOptions?: AlgodClientOptions) => Promise<_algosdk.Algodv2>;
|
|
4
5
|
export default class Algod {
|
|
5
6
|
algosdk: typeof _algosdk;
|
|
6
7
|
algodClient: _algosdk.Algodv2;
|
|
7
8
|
constructor(algosdk: typeof _algosdk, algodClient: _algosdk.Algodv2);
|
|
8
|
-
static init(): Promise<Algod>;
|
|
9
|
+
static init(algodOptions?: AlgodClientOptions): Promise<Algod>;
|
|
9
10
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import BaseWallet from "../base";
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import type { TransactionsArray, Network } from "../../types";
|
|
4
|
+
import type { AlgoSignerTransaction, AlgoSignerClientConstructor, InitParams } from "./types";
|
|
5
|
+
declare class AlgoSignerClient extends BaseWallet {
|
|
6
|
+
#private;
|
|
7
|
+
network: Network;
|
|
8
|
+
constructor({ client, algosdk, algodClient, network, }: AlgoSignerClientConstructor);
|
|
9
|
+
static metadata: {
|
|
10
|
+
id: PROVIDER_ID;
|
|
11
|
+
name: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
isWalletConnect: boolean;
|
|
14
|
+
};
|
|
15
|
+
static init({ algodOptions, algosdkStatic, network, }: InitParams): Promise<AlgoSignerClient | null>;
|
|
16
|
+
connect(): Promise<{
|
|
17
|
+
accounts: {
|
|
18
|
+
name: string;
|
|
19
|
+
address: string;
|
|
20
|
+
providerId: PROVIDER_ID;
|
|
21
|
+
}[];
|
|
22
|
+
id: PROVIDER_ID;
|
|
23
|
+
name: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
isWalletConnect: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
reconnect(onDisconnect: () => void): Promise<null>;
|
|
28
|
+
disconnect(): Promise<void>;
|
|
29
|
+
signTransactions(connectedAccounts: string[], transactions: Uint8Array[]): Promise<Uint8Array[]>;
|
|
30
|
+
/** @deprecated */
|
|
31
|
+
formatTransactionsArray(transactions: TransactionsArray): AlgoSignerTransaction[];
|
|
32
|
+
/** @deprecated */
|
|
33
|
+
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
34
|
+
}
|
|
35
|
+
export default AlgoSignerClient;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type _algosdk from "algosdk";
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import type { AlgodClientOptions, Network } from "../../types";
|
|
4
|
+
export declare type WindowExtended = {
|
|
5
|
+
AlgoSigner: AlgoSigner;
|
|
6
|
+
} & Window & typeof globalThis;
|
|
7
|
+
export declare type AlgoSignerTransaction = {
|
|
8
|
+
txn: string;
|
|
9
|
+
signers?: [];
|
|
10
|
+
multisig?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type SupportedLedgers = "MainNet" | "TestNet" | "BetaNet" | string;
|
|
13
|
+
export declare type AlgoSigner = {
|
|
14
|
+
connect: () => Promise<Record<string, never>>;
|
|
15
|
+
accounts: (ledger: {
|
|
16
|
+
ledger: SupportedLedgers;
|
|
17
|
+
}) => Promise<{
|
|
18
|
+
address: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
signTxn: (transactions: AlgoSignerTransaction[]) => Promise<{
|
|
21
|
+
txID: string;
|
|
22
|
+
blob: string;
|
|
23
|
+
}[]>;
|
|
24
|
+
encoding: {
|
|
25
|
+
msgpackToBase64(transaction: Uint8Array): string;
|
|
26
|
+
byteArrayToString(transaction: Uint8Array): string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare type AlgoSignerClientConstructor = {
|
|
30
|
+
client: AlgoSigner;
|
|
31
|
+
id: PROVIDER_ID;
|
|
32
|
+
algosdk: typeof _algosdk;
|
|
33
|
+
algodClient: _algosdk.Algodv2;
|
|
34
|
+
network: SupportedLedgers;
|
|
35
|
+
};
|
|
36
|
+
export declare type InitParams = {
|
|
37
|
+
algodOptions?: AlgodClientOptions;
|
|
38
|
+
algosdkStatic?: typeof _algosdk;
|
|
39
|
+
network?: Network;
|
|
40
|
+
};
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
import type _algosdk from "algosdk";
|
|
2
|
-
import { PROVIDER_ID } from "
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
connect(onDisconnect: () => void): Promise<Wallet>;
|
|
6
|
-
healthCheck(): Promise<Record<string, never>>;
|
|
7
|
-
disconnect(): Promise<void>;
|
|
8
|
-
reconnect(onDisconnect: () => void): Promise<Wallet | null>;
|
|
9
|
-
decodeTransaction(txn: string, isSigned: boolean): _algosdk.Transaction;
|
|
10
|
-
logEncodedTransaction(txn: string, isSigned: boolean): void;
|
|
11
|
-
groupTransactionsBySender(transactions: TransactionsArray): Record<string, TxnInfo[]>;
|
|
12
|
-
signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>): Promise<Uint8Array[]>;
|
|
13
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
14
|
-
sendRawTransactions(transactions: Uint8Array[], waitRoundsToConfirm?: number): Promise<ConfirmedTxn & {
|
|
15
|
-
id: string;
|
|
16
|
-
}>;
|
|
17
|
-
getAccountInfo(address: string): Promise<AccountInfo>;
|
|
18
|
-
getAssets(address: string): Promise<Asset[]>;
|
|
19
|
-
waitForConfirmation(txId: string, timeout?: number): Promise<ConfirmedTxn>;
|
|
20
|
-
}
|
|
21
|
-
declare abstract class BaseWallet implements BaseWalletInterface {
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import type { Asset, Wallet, AccountInfo, TransactionsArray } from "../../types";
|
|
4
|
+
declare abstract class BaseClient {
|
|
22
5
|
algosdk: typeof _algosdk;
|
|
23
6
|
algodClient: _algosdk.Algodv2;
|
|
24
7
|
keepWCAlive: HTMLAudioElement;
|
|
25
|
-
|
|
26
|
-
|
|
8
|
+
static metadata: {
|
|
9
|
+
id: PROVIDER_ID;
|
|
10
|
+
name: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
isWalletConnect: boolean;
|
|
13
|
+
};
|
|
27
14
|
abstract connect(onDisconnect: () => void): Promise<Wallet>;
|
|
28
15
|
abstract disconnect(): Promise<void>;
|
|
29
16
|
abstract reconnect(onDisconnect: () => void): Promise<Wallet | null>;
|
|
@@ -39,7 +26,7 @@ declare abstract class BaseWallet implements BaseWalletInterface {
|
|
|
39
26
|
"pool-error": string;
|
|
40
27
|
txn: {
|
|
41
28
|
sig: Uint8Array;
|
|
42
|
-
txn: import("
|
|
29
|
+
txn: import("../../types").Txn;
|
|
43
30
|
};
|
|
44
31
|
txId: string;
|
|
45
32
|
}>;
|
|
@@ -52,7 +39,7 @@ declare abstract class BaseWallet implements BaseWalletInterface {
|
|
|
52
39
|
"pool-error": string;
|
|
53
40
|
txn: {
|
|
54
41
|
sig: Uint8Array;
|
|
55
|
-
txn: import("
|
|
42
|
+
txn: import("../../types").Txn;
|
|
56
43
|
};
|
|
57
44
|
txId: string;
|
|
58
45
|
id: any;
|
|
@@ -60,4 +47,4 @@ declare abstract class BaseWallet implements BaseWalletInterface {
|
|
|
60
47
|
keepWCAliveStart(): void;
|
|
61
48
|
keepWCAliveStop(): void;
|
|
62
49
|
}
|
|
63
|
-
export default
|
|
50
|
+
export default BaseClient;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Wallet } from "../../types";
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import BaseWallet from "../base";
|
|
4
|
+
import { TransactionsArray } from "../../types";
|
|
5
|
+
import type { Network } from "../../types";
|
|
6
|
+
import { DeflyTransaction, InitParams, DeflyWalletClientConstructor } from "./types";
|
|
7
|
+
declare class DeflyWalletClient extends BaseWallet {
|
|
8
|
+
#private;
|
|
9
|
+
network: Network;
|
|
10
|
+
constructor({ client, algosdk, algodClient, network, }: DeflyWalletClientConstructor);
|
|
11
|
+
static metadata: {
|
|
12
|
+
id: PROVIDER_ID;
|
|
13
|
+
name: string;
|
|
14
|
+
icon: string;
|
|
15
|
+
isWalletConnect: boolean;
|
|
16
|
+
};
|
|
17
|
+
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams): Promise<DeflyWalletClient | null>;
|
|
18
|
+
connect(onDisconnect: () => void): Promise<Wallet>;
|
|
19
|
+
reconnect(onDisconnect: () => void): Promise<{
|
|
20
|
+
accounts: {
|
|
21
|
+
name: string;
|
|
22
|
+
address: string;
|
|
23
|
+
providerId: PROVIDER_ID;
|
|
24
|
+
}[];
|
|
25
|
+
id: PROVIDER_ID;
|
|
26
|
+
name: string;
|
|
27
|
+
icon: string;
|
|
28
|
+
isWalletConnect: boolean;
|
|
29
|
+
} | null>;
|
|
30
|
+
disconnect(): Promise<void>;
|
|
31
|
+
signTransactions(connectedAccounts: string[], transactions: Uint8Array[]): Promise<Uint8Array[]>;
|
|
32
|
+
/** @deprecated */
|
|
33
|
+
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
34
|
+
/** @deprecated */
|
|
35
|
+
formatTransactionsArray(transactions: TransactionsArray): DeflyTransaction[];
|
|
36
|
+
}
|
|
37
|
+
export default DeflyWalletClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON: string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Transaction } from "algosdk";
|
|
2
|
+
import type { AlgodClientOptions, Network } from "../../types";
|
|
3
|
+
import type { DeflyWalletConnect } from "@blockshake/defly-connect";
|
|
4
|
+
import type _algosdk from "algosdk";
|
|
5
|
+
export declare type ClientOptions = {
|
|
6
|
+
bridge?: string;
|
|
7
|
+
deep_link?: string;
|
|
8
|
+
app_meta?: {
|
|
9
|
+
logo: string;
|
|
10
|
+
name: string;
|
|
11
|
+
main_color: string;
|
|
12
|
+
};
|
|
13
|
+
shouldShowSignTxnToast?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export declare type DeflyTransaction = {
|
|
16
|
+
txn: Transaction;
|
|
17
|
+
/**
|
|
18
|
+
* Optional list of addresses that must sign the transactions.
|
|
19
|
+
* Wallet skips to sign this txn if signers is empty array.
|
|
20
|
+
* If undefined, wallet tries to sign it.
|
|
21
|
+
*/
|
|
22
|
+
signers?: string[];
|
|
23
|
+
};
|
|
24
|
+
export declare type DeflyWalletClientConstructor = {
|
|
25
|
+
client: DeflyWalletConnect;
|
|
26
|
+
algosdk: typeof _algosdk;
|
|
27
|
+
algodClient: _algosdk.Algodv2;
|
|
28
|
+
network: Network;
|
|
29
|
+
};
|
|
30
|
+
export declare type InitParams = {
|
|
31
|
+
clientOptions?: ClientOptions;
|
|
32
|
+
algodOptions?: AlgodClientOptions;
|
|
33
|
+
clientStatic?: typeof DeflyWalletConnect;
|
|
34
|
+
algosdkStatic?: typeof _algosdk;
|
|
35
|
+
network?: Network;
|
|
36
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import BaseWallet from "../base";
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import type { TransactionsArray, Network } from "../../types";
|
|
4
|
+
import { InitParams, ExodusClientConstructor } from "./types";
|
|
5
|
+
declare class ExodusClient extends BaseWallet {
|
|
6
|
+
#private;
|
|
7
|
+
network: Network;
|
|
8
|
+
constructor({ client, algosdk, algodClient, onlyIfTrusted, network, }: ExodusClientConstructor);
|
|
9
|
+
static metadata: {
|
|
10
|
+
id: PROVIDER_ID;
|
|
11
|
+
name: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
isWalletConnect: boolean;
|
|
14
|
+
};
|
|
15
|
+
static init({ clientOptions, algodOptions, algosdkStatic, network, }: InitParams): Promise<ExodusClient | null>;
|
|
16
|
+
connect(): Promise<{
|
|
17
|
+
accounts: {
|
|
18
|
+
name: string;
|
|
19
|
+
address: string;
|
|
20
|
+
providerId: PROVIDER_ID;
|
|
21
|
+
}[];
|
|
22
|
+
id: PROVIDER_ID;
|
|
23
|
+
name: string;
|
|
24
|
+
icon: string;
|
|
25
|
+
isWalletConnect: boolean;
|
|
26
|
+
}>;
|
|
27
|
+
reconnect(onDisconnect: () => void): Promise<null>;
|
|
28
|
+
disconnect(): Promise<void>;
|
|
29
|
+
signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>): Promise<Uint8Array[]>;
|
|
30
|
+
/** @deprecated */
|
|
31
|
+
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
32
|
+
}
|
|
33
|
+
export default ExodusClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON: string;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PROVIDER_ID } from "../../constants";
|
|
2
|
+
import type _algosdk from "algosdk";
|
|
3
|
+
import type { AlgodClientOptions, Network } from "../../types";
|
|
4
|
+
export declare type ClientOptions = {
|
|
5
|
+
onlyIfTrusted: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare type WindowExtended = {
|
|
8
|
+
exodus: {
|
|
9
|
+
algorand: Exodus;
|
|
10
|
+
};
|
|
11
|
+
} & Window & typeof globalThis;
|
|
12
|
+
export declare type Bytes = Readonly<Uint8Array>;
|
|
13
|
+
export declare type Exodus = {
|
|
14
|
+
isConnected: boolean;
|
|
15
|
+
address: string | null;
|
|
16
|
+
connect: ({ onlyIfTrusted }: {
|
|
17
|
+
onlyIfTrusted: boolean;
|
|
18
|
+
}) => Promise<{
|
|
19
|
+
address: string;
|
|
20
|
+
}>;
|
|
21
|
+
disconnect: () => void;
|
|
22
|
+
signAndSendTransaction(transactions: Bytes[]): Promise<{
|
|
23
|
+
txId: string;
|
|
24
|
+
}>;
|
|
25
|
+
signTransaction(transactions: Bytes[]): Promise<Bytes[]>;
|
|
26
|
+
};
|
|
27
|
+
export declare type ExodusClientConstructor = {
|
|
28
|
+
client: Exodus;
|
|
29
|
+
id: PROVIDER_ID;
|
|
30
|
+
algosdk: typeof _algosdk;
|
|
31
|
+
algodClient: _algosdk.Algodv2;
|
|
32
|
+
onlyIfTrusted: boolean;
|
|
33
|
+
network: Network;
|
|
34
|
+
};
|
|
35
|
+
export declare type InitParams = {
|
|
36
|
+
clientOptions?: ClientOptions;
|
|
37
|
+
algodOptions?: AlgodClientOptions;
|
|
38
|
+
algosdkStatic?: typeof _algosdk;
|
|
39
|
+
network?: Network;
|
|
40
|
+
};
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"MyAlgo Wallet": Promise<void | myAlgoWalletClient>;
|
|
12
|
-
"Algo Signer": Promise<void | algoSignerClient>;
|
|
13
|
-
Defly: Promise<void | deflyClient>;
|
|
14
|
-
Exodus: Promise<void | exodusClient>;
|
|
15
|
-
"Wallet Connect": Promise<void | walletconnectClient>;
|
|
1
|
+
import pera from "./pera";
|
|
2
|
+
import myalgo from "./myalgo";
|
|
3
|
+
import defly from "./defly";
|
|
4
|
+
import exodus from "./exodus";
|
|
5
|
+
import algosigner from "./algosigner";
|
|
6
|
+
import walletconnect from "./walletconnect";
|
|
7
|
+
import kmd from "./kmd";
|
|
8
|
+
export { pera, myalgo, defly, exodus, algosigner, walletconnect, kmd };
|
|
9
|
+
declare const _default: {
|
|
10
|
+
[x: string]: typeof pera | typeof myalgo | typeof defly | typeof exodus | typeof algosigner | typeof walletconnect | typeof kmd;
|
|
16
11
|
};
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import BaseWallet from "../base";
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import type { Account, Wallet, TransactionsArray, Network } from "../../types";
|
|
4
|
+
import { InitParams, KMDWalletClientConstructor } from "./types";
|
|
5
|
+
declare class KMDWalletClient extends BaseWallet {
|
|
6
|
+
#private;
|
|
7
|
+
walletId: string;
|
|
8
|
+
id: PROVIDER_ID;
|
|
9
|
+
network: Network;
|
|
10
|
+
constructor({ client, id, wallet, password, algosdk, algodClient, network, }: KMDWalletClientConstructor);
|
|
11
|
+
static metadata: {
|
|
12
|
+
id: PROVIDER_ID;
|
|
13
|
+
name: string;
|
|
14
|
+
icon: string;
|
|
15
|
+
isWalletConnect: boolean;
|
|
16
|
+
};
|
|
17
|
+
static init({ clientOptions, algodOptions, algosdkStatic, network, }: InitParams): Promise<KMDWalletClient | null>;
|
|
18
|
+
connect(): Promise<Wallet>;
|
|
19
|
+
disconnect(): Promise<void>;
|
|
20
|
+
reconnect(): Promise<Wallet | null>;
|
|
21
|
+
requestPassword(): Promise<string>;
|
|
22
|
+
getWalletToken(walletId: string, password: string): Promise<string>;
|
|
23
|
+
releaseToken(token: string): Promise<void>;
|
|
24
|
+
listWallets(): Promise<Record<string, string>>;
|
|
25
|
+
listAccounts(wallet: string, password: string): Promise<Array<Account>>;
|
|
26
|
+
signTransactions(connectedAccounts: string[], transactions: Uint8Array[]): Promise<Uint8Array[]>;
|
|
27
|
+
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
28
|
+
}
|
|
29
|
+
export default KMDWalletClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON: string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type _algosdk from "algosdk";
|
|
2
|
+
import type { AlgodClientOptions, Network } 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 ListWalletResponse {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
driver_name?: string;
|
|
15
|
+
driver_version?: number;
|
|
16
|
+
mnemonic_ux?: boolean;
|
|
17
|
+
supported_txs?: Array<any>;
|
|
18
|
+
}
|
|
19
|
+
export interface InitWalletHandle {
|
|
20
|
+
wallet_handle_token: string;
|
|
21
|
+
message?: string;
|
|
22
|
+
error?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare type KMDWalletClientConstructor = {
|
|
25
|
+
client: _algosdk.Kmd;
|
|
26
|
+
id: PROVIDER_ID;
|
|
27
|
+
algosdk: typeof _algosdk;
|
|
28
|
+
algodClient: _algosdk.Algodv2;
|
|
29
|
+
wallet: string;
|
|
30
|
+
password: string;
|
|
31
|
+
network: Network;
|
|
32
|
+
};
|
|
33
|
+
export declare type InitParams = {
|
|
34
|
+
clientOptions?: ClientOptions;
|
|
35
|
+
algodOptions?: AlgodClientOptions;
|
|
36
|
+
algosdkStatic?: typeof _algosdk;
|
|
37
|
+
network?: Network;
|
|
38
|
+
};
|
|
@@ -2,25 +2,21 @@
|
|
|
2
2
|
* Helpful resources:
|
|
3
3
|
* https://github.com/randlabs/myalgo-connect
|
|
4
4
|
*/
|
|
5
|
-
import BaseWallet from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import type { WalletProvider } from "../types";
|
|
10
|
-
import { TransactionsArray } from "../types";
|
|
11
|
-
declare type InitWallet = {
|
|
12
|
-
id: PROVIDER_ID;
|
|
13
|
-
client: MyAlgoConnect;
|
|
14
|
-
provider: WalletProvider;
|
|
15
|
-
algosdk: typeof _algosdk;
|
|
16
|
-
algodClient: _algosdk.Algodv2;
|
|
17
|
-
};
|
|
5
|
+
import BaseWallet from "../base";
|
|
6
|
+
import { PROVIDER_ID } from "../../constants";
|
|
7
|
+
import { TransactionsArray, Network } from "../../types";
|
|
8
|
+
import { MyAlgoWalletClientConstructor, InitParams } from "./types";
|
|
18
9
|
declare class MyAlgoWalletClient extends BaseWallet {
|
|
19
10
|
#private;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
network: Network;
|
|
12
|
+
constructor({ client, algosdk, algodClient, network, }: MyAlgoWalletClientConstructor);
|
|
13
|
+
static metadata: {
|
|
14
|
+
id: PROVIDER_ID;
|
|
15
|
+
name: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
isWalletConnect: boolean;
|
|
18
|
+
};
|
|
19
|
+
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams): Promise<MyAlgoWalletClient | null>;
|
|
24
20
|
connect(): Promise<{
|
|
25
21
|
accounts: {
|
|
26
22
|
providerId: PROVIDER_ID;
|
|
@@ -35,6 +31,7 @@ declare class MyAlgoWalletClient extends BaseWallet {
|
|
|
35
31
|
reconnect(): Promise<null>;
|
|
36
32
|
disconnect(): Promise<void>;
|
|
37
33
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[]): Promise<Uint8Array[]>;
|
|
34
|
+
/** @deprecated */
|
|
38
35
|
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
39
36
|
}
|
|
40
37
|
export default MyAlgoWalletClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpful resources:
|
|
3
|
+
* https://github.com/randlabs/myalgo-connect
|
|
4
|
+
*/
|
|
5
|
+
import type _MyAlgoConnect from "@randlabs/myalgo-connect";
|
|
6
|
+
import type _algosdk from "algosdk";
|
|
7
|
+
import { AlgodClientOptions, Network } from "../../types";
|
|
8
|
+
export declare type MyAlgoWalletClientConstructor = {
|
|
9
|
+
client: _MyAlgoConnect;
|
|
10
|
+
algosdk: typeof _algosdk;
|
|
11
|
+
algodClient: _algosdk.Algodv2;
|
|
12
|
+
network: Network;
|
|
13
|
+
};
|
|
14
|
+
export declare type ClientOptions = {
|
|
15
|
+
disableLedgerNano: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare type InitParams = {
|
|
18
|
+
clientOptions?: ClientOptions;
|
|
19
|
+
algodOptions?: AlgodClientOptions;
|
|
20
|
+
clientStatic?: typeof _MyAlgoConnect;
|
|
21
|
+
algosdkStatic?: typeof _algosdk;
|
|
22
|
+
network?: Network;
|
|
23
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Wallet, TransactionsArray, Network } from "../../types";
|
|
2
|
+
import { PROVIDER_ID } from "../../constants";
|
|
3
|
+
import BaseWallet from "../base";
|
|
4
|
+
import { PeraTransaction, PeraWalletClientConstructor, InitParams } from "./types";
|
|
5
|
+
declare class PeraWalletClient extends BaseWallet {
|
|
6
|
+
#private;
|
|
7
|
+
network: Network;
|
|
8
|
+
constructor({ client, algosdk, algodClient, network, }: PeraWalletClientConstructor);
|
|
9
|
+
static metadata: {
|
|
10
|
+
id: PROVIDER_ID;
|
|
11
|
+
name: string;
|
|
12
|
+
icon: string;
|
|
13
|
+
isWalletConnect: boolean;
|
|
14
|
+
};
|
|
15
|
+
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams): Promise<PeraWalletClient | null>;
|
|
16
|
+
connect(onDisconnect: () => void): Promise<Wallet>;
|
|
17
|
+
reconnect(onDisconnect: () => void): Promise<{
|
|
18
|
+
accounts: {
|
|
19
|
+
name: string;
|
|
20
|
+
address: string;
|
|
21
|
+
providerId: PROVIDER_ID;
|
|
22
|
+
}[];
|
|
23
|
+
id: PROVIDER_ID;
|
|
24
|
+
name: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
isWalletConnect: boolean;
|
|
27
|
+
} | null>;
|
|
28
|
+
disconnect(): Promise<void>;
|
|
29
|
+
signTransactions(connectedAccounts: string[], transactions: Uint8Array[]): Promise<Uint8Array[]>;
|
|
30
|
+
/** @deprecated */
|
|
31
|
+
formatTransactionsArray(transactions: TransactionsArray): PeraTransaction[];
|
|
32
|
+
/** @deprecated */
|
|
33
|
+
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
34
|
+
}
|
|
35
|
+
export default PeraWalletClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON: string;
|