@txnlab/use-wallet 1.2.0 → 1.2.2
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 +0 -48
- 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/kmd/client.d.ts +1 -2
- 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/hooks/useWallet.d.ts +0 -12
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +20 -210
- package/dist/cjs/index.js.map +1 -1
- 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/kmd/client.d.ts +1 -2
- 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/hooks/useWallet.d.ts +0 -12
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +20 -211
- package/dist/esm/utils/encodeNFDTransactionsArray.d.ts +2 -0
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/index.d.ts +6 -65
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _algosdk
|
|
1
|
+
import _algosdk from 'algosdk';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { PeraWalletConnect } from '@perawallet/connect';
|
|
4
4
|
import _MyAlgoConnect from '@randlabs/myalgo-connect';
|
|
@@ -85,7 +85,6 @@ declare abstract class BaseClient {
|
|
|
85
85
|
abstract disconnect(): Promise<void>;
|
|
86
86
|
abstract reconnect(onDisconnect: () => void): Promise<Wallet | null>;
|
|
87
87
|
abstract signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>, indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
88
|
-
abstract signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
89
88
|
protected constructor(metadata: Metadata, algosdk: typeof _algosdk, algodClient: _algosdk.Algodv2);
|
|
90
89
|
healthCheck(): Promise<{}>;
|
|
91
90
|
getAccountInfo(address: string): Promise<AccountInfo>;
|
|
@@ -204,18 +203,6 @@ declare function useWallet(): {
|
|
|
204
203
|
groupTransactionsBySender: (transactions: TransactionsArray) => Promise<Record<string, any>>;
|
|
205
204
|
getAccountInfo: () => Promise<AccountInfo>;
|
|
206
205
|
getAssets: () => Promise<Asset[]>;
|
|
207
|
-
signEncodedTransactions: (transactions: TransactionsArray) => Promise<Uint8Array[]>;
|
|
208
|
-
sendRawTransactions: (transactions: Uint8Array[], waitRoundsToConfirm?: number) => Promise<{
|
|
209
|
-
"confirmed-round": number;
|
|
210
|
-
"global-state-delta": Record<string, unknown>[];
|
|
211
|
-
"pool-error": string;
|
|
212
|
-
txn: {
|
|
213
|
-
sig: Uint8Array;
|
|
214
|
-
txn: Txn;
|
|
215
|
-
};
|
|
216
|
-
txId: string;
|
|
217
|
-
id: any;
|
|
218
|
-
}>;
|
|
219
206
|
};
|
|
220
207
|
|
|
221
208
|
declare type SupportedProviders$1 = {
|
|
@@ -234,6 +221,9 @@ declare type SupportedProviders = {
|
|
|
234
221
|
};
|
|
235
222
|
declare const reconnectProviders: (providers: SupportedProviders) => Promise<void>;
|
|
236
223
|
|
|
224
|
+
declare type NFDTransactionsArray = ["u" | "s", string][];
|
|
225
|
+
declare function encodeNFDTransactionsArray(transactionsArray: NFDTransactionsArray): Uint8Array[];
|
|
226
|
+
|
|
237
227
|
declare const _default: react.Provider<Partial<{
|
|
238
228
|
kmd: Promise<BaseClient | null>;
|
|
239
229
|
pera: Promise<BaseClient | null>;
|
|
@@ -247,23 +237,9 @@ declare const _default: react.Provider<Partial<{
|
|
|
247
237
|
|
|
248
238
|
declare type ClientOptions$6 = {
|
|
249
239
|
bridge?: string;
|
|
250
|
-
deep_link?: string;
|
|
251
|
-
app_meta?: {
|
|
252
|
-
logo: string;
|
|
253
|
-
name: string;
|
|
254
|
-
main_color: string;
|
|
255
|
-
};
|
|
256
240
|
shouldShowSignTxnToast?: boolean;
|
|
241
|
+
chainId?: 416001 | 416002 | 416003 | 4160;
|
|
257
242
|
};
|
|
258
|
-
interface PeraTransaction {
|
|
259
|
-
txn: Transaction;
|
|
260
|
-
/**
|
|
261
|
-
* Optional list of addresses that must sign the transactions.
|
|
262
|
-
* Wallet skips to sign this txn if signers is empty array.
|
|
263
|
-
* If undefined, wallet tries to sign it.
|
|
264
|
-
*/
|
|
265
|
-
signers?: string[];
|
|
266
|
-
}
|
|
267
243
|
declare type PeraWalletClientConstructor = {
|
|
268
244
|
metadata: Metadata;
|
|
269
245
|
client: PeraWalletConnect;
|
|
@@ -304,10 +280,6 @@ declare class PeraWalletClient extends BaseClient {
|
|
|
304
280
|
} | null>;
|
|
305
281
|
disconnect(): Promise<void>;
|
|
306
282
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
307
|
-
/** @deprecated */
|
|
308
|
-
formatTransactionsArray(transactions: TransactionsArray): PeraTransaction[];
|
|
309
|
-
/** @deprecated */
|
|
310
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
311
283
|
}
|
|
312
284
|
|
|
313
285
|
/**
|
|
@@ -363,8 +335,6 @@ declare class MyAlgoWalletClient extends BaseClient {
|
|
|
363
335
|
reconnect(): Promise<null>;
|
|
364
336
|
disconnect(): Promise<void>;
|
|
365
337
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
366
|
-
/** @deprecated */
|
|
367
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
368
338
|
}
|
|
369
339
|
|
|
370
340
|
declare type ClientOptions$4 = {
|
|
@@ -377,15 +347,6 @@ declare type ClientOptions$4 = {
|
|
|
377
347
|
};
|
|
378
348
|
shouldShowSignTxnToast?: boolean;
|
|
379
349
|
};
|
|
380
|
-
declare type DeflyTransaction = {
|
|
381
|
-
txn: Transaction;
|
|
382
|
-
/**
|
|
383
|
-
* Optional list of addresses that must sign the transactions.
|
|
384
|
-
* Wallet skips to sign this txn if signers is empty array.
|
|
385
|
-
* If undefined, wallet tries to sign it.
|
|
386
|
-
*/
|
|
387
|
-
signers?: string[];
|
|
388
|
-
};
|
|
389
350
|
declare type DeflyWalletClientConstructor = {
|
|
390
351
|
metadata: Metadata;
|
|
391
352
|
client: DeflyWalletConnect;
|
|
@@ -426,10 +387,6 @@ declare class DeflyWalletClient extends BaseClient {
|
|
|
426
387
|
} | null>;
|
|
427
388
|
disconnect(): Promise<void>;
|
|
428
389
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
429
|
-
/** @deprecated */
|
|
430
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
431
|
-
/** @deprecated */
|
|
432
|
-
formatTransactionsArray(transactions: TransactionsArray): DeflyTransaction[];
|
|
433
390
|
}
|
|
434
391
|
|
|
435
392
|
declare type ClientOptions$3 = {
|
|
@@ -491,8 +448,6 @@ declare class ExodusClient extends BaseClient {
|
|
|
491
448
|
reconnect(onDisconnect: () => void): Promise<null>;
|
|
492
449
|
disconnect(): Promise<void>;
|
|
493
450
|
signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>, indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
494
|
-
/** @deprecated */
|
|
495
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
496
451
|
}
|
|
497
452
|
|
|
498
453
|
declare type AlgoSignerTransaction = {
|
|
@@ -556,10 +511,6 @@ declare class AlgoSignerClient extends BaseClient {
|
|
|
556
511
|
reconnect(onDisconnect: () => void): Promise<null>;
|
|
557
512
|
disconnect(): Promise<void>;
|
|
558
513
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
559
|
-
/** @deprecated */
|
|
560
|
-
formatTransactionsArray(transactions: TransactionsArray): AlgoSignerTransaction[];
|
|
561
|
-
/** @deprecated */
|
|
562
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
563
514
|
}
|
|
564
515
|
|
|
565
516
|
interface IClientMeta {
|
|
@@ -593,11 +544,6 @@ declare type ClientOptions$2 = {
|
|
|
593
544
|
session?: IWalletConnectSession;
|
|
594
545
|
clientMeta?: IClientMeta;
|
|
595
546
|
};
|
|
596
|
-
declare type WalletConnectTransaction = {
|
|
597
|
-
txn: string;
|
|
598
|
-
message?: string;
|
|
599
|
-
signers?: string[] | [];
|
|
600
|
-
};
|
|
601
547
|
declare type InitParams$2 = {
|
|
602
548
|
clientOptions?: ClientOptions$2;
|
|
603
549
|
algodOptions?: AlgodClientOptions;
|
|
@@ -640,10 +586,6 @@ declare class WalletConnectClient extends BaseClient {
|
|
|
640
586
|
check(): boolean;
|
|
641
587
|
disconnect(): Promise<void>;
|
|
642
588
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
643
|
-
/** @deprecarted */
|
|
644
|
-
formatTransactionsArray(transactions: TransactionsArray): WalletConnectTransaction[];
|
|
645
|
-
/** @deprecated */
|
|
646
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
647
589
|
}
|
|
648
590
|
|
|
649
591
|
declare type ClientOptions$1 = {
|
|
@@ -693,7 +635,6 @@ declare class KMDWalletClient extends BaseClient {
|
|
|
693
635
|
listAccounts(wallet: string, password: string): Promise<Array<Account>>;
|
|
694
636
|
getWalletId(): Promise<string>;
|
|
695
637
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
696
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
697
638
|
}
|
|
698
639
|
|
|
699
640
|
declare type ClientOptions = {
|
|
@@ -737,4 +678,4 @@ declare class MnemonicWalletClient extends BaseClient {
|
|
|
737
678
|
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
738
679
|
}
|
|
739
680
|
|
|
740
|
-
export { Account, AccountInfo, AlgodClientOptions, Asset, ConfirmedTxn, DEFAULT_NETWORK, DEFAULT_NODE_BASEURL, DEFAULT_NODE_PORT, DEFAULT_NODE_TOKEN, DecodedSignedTransaction, DecodedTransaction, Metadata, Network, PROVIDER_ID, Provider, TransactionsArray, Txn, TxnInfo, TxnType, Wallet, WalletClient, _default as WalletProvider, AlgoSignerClient as algosigner, DeflyWalletClient as defly, ExodusClient as exodus, initializeProviders, KMDWalletClient as kmd, MnemonicWalletClient as mnemonic, MyAlgoWalletClient as myalgo, PeraWalletClient as pera, reconnectProviders, useWallet, WalletConnectClient as walletconnect };
|
|
681
|
+
export { Account, AccountInfo, AlgodClientOptions, Asset, ConfirmedTxn, DEFAULT_NETWORK, DEFAULT_NODE_BASEURL, DEFAULT_NODE_PORT, DEFAULT_NODE_TOKEN, DecodedSignedTransaction, DecodedTransaction, Metadata, Network, PROVIDER_ID, Provider, TransactionsArray, Txn, TxnInfo, TxnType, Wallet, WalletClient, _default as WalletProvider, AlgoSignerClient as algosigner, DeflyWalletClient as defly, encodeNFDTransactionsArray, ExodusClient as exodus, initializeProviders, KMDWalletClient as kmd, MnemonicWalletClient as mnemonic, MyAlgoWalletClient as myalgo, PeraWalletClient as pera, reconnectProviders, useWallet, WalletConnectClient as walletconnect };
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"url": "https://github.com/txnlab/use-wallet/issues"
|
|
13
13
|
},
|
|
14
14
|
"homepage": "https://txnlab.github.io/use-wallet",
|
|
15
|
-
"version": "1.2.
|
|
15
|
+
"version": "1.2.2",
|
|
16
16
|
"description": "React hooks for using Algorand compatible wallets in dApps.",
|
|
17
17
|
"scripts": {
|
|
18
18
|
"dev": "yarn storybook",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@blockshake/defly-connect": "^1.0.0",
|
|
34
34
|
"@json-rpc-tools/utils": "^1.7.6",
|
|
35
35
|
"@mdx-js/react": "^2.1.2",
|
|
36
|
-
"@perawallet/connect": "^1.0
|
|
36
|
+
"@perawallet/connect": "^1.1.0",
|
|
37
37
|
"@randlabs/myalgo-connect": "^1.4.2",
|
|
38
38
|
"@rollup/plugin-commonjs": "^23.0.2",
|
|
39
39
|
"@rollup/plugin-json": "^5.0.1",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/react": "^18.0.15",
|
|
52
52
|
"@walletconnect/client": "^1.8.0",
|
|
53
53
|
"algorand-walletconnect-qrcode-modal": "^1.8.0",
|
|
54
|
-
"algosdk": "^1.
|
|
54
|
+
"algosdk": "^2.1.0",
|
|
55
55
|
"babel-jest": "^29.1.2",
|
|
56
56
|
"babel-loader": "^8.2.3",
|
|
57
57
|
"css-loader": "^6.5.1",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"@randlabs/myalgo-connect": "^1.4.2",
|
|
84
84
|
"@walletconnect/client": "^1.8.0",
|
|
85
85
|
"algorand-walletconnect-qrcode-modal": "^1.8.0",
|
|
86
|
-
"algosdk": "^1.
|
|
86
|
+
"algosdk": "^2.1.0",
|
|
87
87
|
"react": "^18.2.0"
|
|
88
88
|
},
|
|
89
89
|
"main": "dist/cjs/index.js",
|