@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
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';
|
|
@@ -67,7 +67,8 @@ declare enum PROVIDER_ID {
|
|
|
67
67
|
ALGOSIGNER = "algosigner",
|
|
68
68
|
DEFLY = "defly",
|
|
69
69
|
EXODUS = "exodus",
|
|
70
|
-
WALLETCONNECT = "walletconnect"
|
|
70
|
+
WALLETCONNECT = "walletconnect",
|
|
71
|
+
MNEMONIC = "mnemonic"
|
|
71
72
|
}
|
|
72
73
|
declare const DEFAULT_NETWORK: Network;
|
|
73
74
|
declare const DEFAULT_NODE_BASEURL = "https://mainnet-api.algonode.cloud";
|
|
@@ -84,7 +85,6 @@ declare abstract class BaseClient {
|
|
|
84
85
|
abstract disconnect(): Promise<void>;
|
|
85
86
|
abstract reconnect(onDisconnect: () => void): Promise<Wallet | null>;
|
|
86
87
|
abstract signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>, indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
87
|
-
abstract signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
88
88
|
protected constructor(metadata: Metadata, algosdk: typeof _algosdk, algodClient: _algosdk.Algodv2);
|
|
89
89
|
healthCheck(): Promise<{}>;
|
|
90
90
|
getAccountInfo(address: string): Promise<AccountInfo>;
|
|
@@ -176,6 +176,7 @@ declare function useWallet(): {
|
|
|
176
176
|
defly: Promise<BaseClient | null>;
|
|
177
177
|
exodus: Promise<BaseClient | null>;
|
|
178
178
|
walletconnect: Promise<BaseClient | null>;
|
|
179
|
+
mnemonic: Promise<BaseClient | null>;
|
|
179
180
|
}> | null;
|
|
180
181
|
providers: Provider[] | null;
|
|
181
182
|
connectedAccounts: Account[];
|
|
@@ -202,18 +203,6 @@ declare function useWallet(): {
|
|
|
202
203
|
groupTransactionsBySender: (transactions: TransactionsArray) => Promise<Record<string, any>>;
|
|
203
204
|
getAccountInfo: () => Promise<AccountInfo>;
|
|
204
205
|
getAssets: () => Promise<Asset[]>;
|
|
205
|
-
signEncodedTransactions: (transactions: TransactionsArray) => Promise<Uint8Array[]>;
|
|
206
|
-
sendRawTransactions: (transactions: Uint8Array[], waitRoundsToConfirm?: number) => Promise<{
|
|
207
|
-
"confirmed-round": number;
|
|
208
|
-
"global-state-delta": Record<string, unknown>[];
|
|
209
|
-
"pool-error": string;
|
|
210
|
-
txn: {
|
|
211
|
-
sig: Uint8Array;
|
|
212
|
-
txn: Txn;
|
|
213
|
-
};
|
|
214
|
-
txId: string;
|
|
215
|
-
id: any;
|
|
216
|
-
}>;
|
|
217
206
|
};
|
|
218
207
|
|
|
219
208
|
declare type SupportedProviders$1 = {
|
|
@@ -232,6 +221,9 @@ declare type SupportedProviders = {
|
|
|
232
221
|
};
|
|
233
222
|
declare const reconnectProviders: (providers: SupportedProviders) => Promise<void>;
|
|
234
223
|
|
|
224
|
+
declare type NFDTransactionsArray = ["u" | "s", string][];
|
|
225
|
+
declare function encodeNFDTransactionsArray(transactionsArray: NFDTransactionsArray): Uint8Array[];
|
|
226
|
+
|
|
235
227
|
declare const _default: react.Provider<Partial<{
|
|
236
228
|
kmd: Promise<BaseClient | null>;
|
|
237
229
|
pera: Promise<BaseClient | null>;
|
|
@@ -240,27 +232,14 @@ declare const _default: react.Provider<Partial<{
|
|
|
240
232
|
defly: Promise<BaseClient | null>;
|
|
241
233
|
exodus: Promise<BaseClient | null>;
|
|
242
234
|
walletconnect: Promise<BaseClient | null>;
|
|
235
|
+
mnemonic: Promise<BaseClient | null>;
|
|
243
236
|
}> | null>;
|
|
244
237
|
|
|
245
|
-
declare type ClientOptions$
|
|
238
|
+
declare type ClientOptions$6 = {
|
|
246
239
|
bridge?: string;
|
|
247
|
-
deep_link?: string;
|
|
248
|
-
app_meta?: {
|
|
249
|
-
logo: string;
|
|
250
|
-
name: string;
|
|
251
|
-
main_color: string;
|
|
252
|
-
};
|
|
253
240
|
shouldShowSignTxnToast?: boolean;
|
|
241
|
+
chainId?: 416001 | 416002 | 416003 | 4160;
|
|
254
242
|
};
|
|
255
|
-
interface PeraTransaction {
|
|
256
|
-
txn: Transaction;
|
|
257
|
-
/**
|
|
258
|
-
* Optional list of addresses that must sign the transactions.
|
|
259
|
-
* Wallet skips to sign this txn if signers is empty array.
|
|
260
|
-
* If undefined, wallet tries to sign it.
|
|
261
|
-
*/
|
|
262
|
-
signers?: string[];
|
|
263
|
-
}
|
|
264
243
|
declare type PeraWalletClientConstructor = {
|
|
265
244
|
metadata: Metadata;
|
|
266
245
|
client: PeraWalletConnect;
|
|
@@ -268,8 +247,8 @@ declare type PeraWalletClientConstructor = {
|
|
|
268
247
|
algodClient: _algosdk.Algodv2;
|
|
269
248
|
network: Network;
|
|
270
249
|
};
|
|
271
|
-
declare type InitParams$
|
|
272
|
-
clientOptions?: ClientOptions$
|
|
250
|
+
declare type InitParams$7 = {
|
|
251
|
+
clientOptions?: ClientOptions$6;
|
|
273
252
|
algodOptions?: AlgodClientOptions;
|
|
274
253
|
clientStatic?: typeof PeraWalletConnect;
|
|
275
254
|
algosdkStatic?: typeof _algosdk;
|
|
@@ -286,7 +265,7 @@ declare class PeraWalletClient extends BaseClient {
|
|
|
286
265
|
icon: string;
|
|
287
266
|
isWalletConnect: boolean;
|
|
288
267
|
};
|
|
289
|
-
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams$
|
|
268
|
+
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams$7): Promise<PeraWalletClient | null>;
|
|
290
269
|
connect(onDisconnect: () => void): Promise<Wallet>;
|
|
291
270
|
reconnect(onDisconnect: () => void): Promise<{
|
|
292
271
|
accounts: {
|
|
@@ -301,10 +280,6 @@ declare class PeraWalletClient extends BaseClient {
|
|
|
301
280
|
} | null>;
|
|
302
281
|
disconnect(): Promise<void>;
|
|
303
282
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
304
|
-
/** @deprecated */
|
|
305
|
-
formatTransactionsArray(transactions: TransactionsArray): PeraTransaction[];
|
|
306
|
-
/** @deprecated */
|
|
307
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
308
283
|
}
|
|
309
284
|
|
|
310
285
|
/**
|
|
@@ -319,11 +294,11 @@ declare type MyAlgoWalletClientConstructor = {
|
|
|
319
294
|
algodClient: _algosdk.Algodv2;
|
|
320
295
|
network: Network;
|
|
321
296
|
};
|
|
322
|
-
declare type ClientOptions$
|
|
297
|
+
declare type ClientOptions$5 = {
|
|
323
298
|
disableLedgerNano: boolean;
|
|
324
299
|
};
|
|
325
|
-
declare type InitParams$
|
|
326
|
-
clientOptions?: ClientOptions$
|
|
300
|
+
declare type InitParams$6 = {
|
|
301
|
+
clientOptions?: ClientOptions$5;
|
|
327
302
|
algodOptions?: AlgodClientOptions;
|
|
328
303
|
clientStatic?: typeof _MyAlgoConnect;
|
|
329
304
|
algosdkStatic?: typeof _algosdk;
|
|
@@ -345,7 +320,7 @@ declare class MyAlgoWalletClient extends BaseClient {
|
|
|
345
320
|
icon: string;
|
|
346
321
|
isWalletConnect: boolean;
|
|
347
322
|
};
|
|
348
|
-
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams$
|
|
323
|
+
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams$6): Promise<MyAlgoWalletClient | null>;
|
|
349
324
|
connect(): Promise<{
|
|
350
325
|
accounts: {
|
|
351
326
|
providerId: PROVIDER_ID;
|
|
@@ -360,11 +335,9 @@ declare class MyAlgoWalletClient extends BaseClient {
|
|
|
360
335
|
reconnect(): Promise<null>;
|
|
361
336
|
disconnect(): Promise<void>;
|
|
362
337
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
363
|
-
/** @deprecated */
|
|
364
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
365
338
|
}
|
|
366
339
|
|
|
367
|
-
declare type ClientOptions$
|
|
340
|
+
declare type ClientOptions$4 = {
|
|
368
341
|
bridge?: string;
|
|
369
342
|
deep_link?: string;
|
|
370
343
|
app_meta?: {
|
|
@@ -374,15 +347,6 @@ declare type ClientOptions$3 = {
|
|
|
374
347
|
};
|
|
375
348
|
shouldShowSignTxnToast?: boolean;
|
|
376
349
|
};
|
|
377
|
-
declare type DeflyTransaction = {
|
|
378
|
-
txn: Transaction;
|
|
379
|
-
/**
|
|
380
|
-
* Optional list of addresses that must sign the transactions.
|
|
381
|
-
* Wallet skips to sign this txn if signers is empty array.
|
|
382
|
-
* If undefined, wallet tries to sign it.
|
|
383
|
-
*/
|
|
384
|
-
signers?: string[];
|
|
385
|
-
};
|
|
386
350
|
declare type DeflyWalletClientConstructor = {
|
|
387
351
|
metadata: Metadata;
|
|
388
352
|
client: DeflyWalletConnect;
|
|
@@ -390,8 +354,8 @@ declare type DeflyWalletClientConstructor = {
|
|
|
390
354
|
algodClient: _algosdk.Algodv2;
|
|
391
355
|
network: Network;
|
|
392
356
|
};
|
|
393
|
-
declare type InitParams$
|
|
394
|
-
clientOptions?: ClientOptions$
|
|
357
|
+
declare type InitParams$5 = {
|
|
358
|
+
clientOptions?: ClientOptions$4;
|
|
395
359
|
algodOptions?: AlgodClientOptions;
|
|
396
360
|
clientStatic?: typeof DeflyWalletConnect;
|
|
397
361
|
algosdkStatic?: typeof _algosdk;
|
|
@@ -408,7 +372,7 @@ declare class DeflyWalletClient extends BaseClient {
|
|
|
408
372
|
icon: string;
|
|
409
373
|
isWalletConnect: boolean;
|
|
410
374
|
};
|
|
411
|
-
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams$
|
|
375
|
+
static init({ clientOptions, algodOptions, clientStatic, algosdkStatic, network, }: InitParams$5): Promise<DeflyWalletClient | null>;
|
|
412
376
|
connect(onDisconnect: () => void): Promise<Wallet>;
|
|
413
377
|
reconnect(onDisconnect: () => void): Promise<{
|
|
414
378
|
accounts: {
|
|
@@ -423,13 +387,9 @@ declare class DeflyWalletClient extends BaseClient {
|
|
|
423
387
|
} | null>;
|
|
424
388
|
disconnect(): Promise<void>;
|
|
425
389
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
426
|
-
/** @deprecated */
|
|
427
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
428
|
-
/** @deprecated */
|
|
429
|
-
formatTransactionsArray(transactions: TransactionsArray): DeflyTransaction[];
|
|
430
390
|
}
|
|
431
391
|
|
|
432
|
-
declare type ClientOptions$
|
|
392
|
+
declare type ClientOptions$3 = {
|
|
433
393
|
onlyIfTrusted: boolean;
|
|
434
394
|
};
|
|
435
395
|
declare type Bytes = Readonly<Uint8Array>;
|
|
@@ -456,8 +416,8 @@ declare type ExodusClientConstructor = {
|
|
|
456
416
|
onlyIfTrusted: boolean;
|
|
457
417
|
network: Network;
|
|
458
418
|
};
|
|
459
|
-
declare type InitParams$
|
|
460
|
-
clientOptions?: ClientOptions$
|
|
419
|
+
declare type InitParams$4 = {
|
|
420
|
+
clientOptions?: ClientOptions$3;
|
|
461
421
|
algodOptions?: AlgodClientOptions;
|
|
462
422
|
algosdkStatic?: typeof _algosdk;
|
|
463
423
|
network?: Network;
|
|
@@ -473,7 +433,7 @@ declare class ExodusClient extends BaseClient {
|
|
|
473
433
|
icon: string;
|
|
474
434
|
isWalletConnect: boolean;
|
|
475
435
|
};
|
|
476
|
-
static init({ clientOptions, algodOptions, algosdkStatic, network, }: InitParams$
|
|
436
|
+
static init({ clientOptions, algodOptions, algosdkStatic, network, }: InitParams$4): Promise<ExodusClient | null>;
|
|
477
437
|
connect(): Promise<{
|
|
478
438
|
accounts: {
|
|
479
439
|
name: string;
|
|
@@ -488,8 +448,6 @@ declare class ExodusClient extends BaseClient {
|
|
|
488
448
|
reconnect(onDisconnect: () => void): Promise<null>;
|
|
489
449
|
disconnect(): Promise<void>;
|
|
490
450
|
signTransactions(connectedAccounts: string[], transactions: Array<Uint8Array>, indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
491
|
-
/** @deprecated */
|
|
492
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
493
451
|
}
|
|
494
452
|
|
|
495
453
|
declare type AlgoSignerTransaction = {
|
|
@@ -522,7 +480,7 @@ declare type AlgoSignerClientConstructor = {
|
|
|
522
480
|
algodClient: _algosdk.Algodv2;
|
|
523
481
|
network: SupportedLedgers;
|
|
524
482
|
};
|
|
525
|
-
declare type InitParams$
|
|
483
|
+
declare type InitParams$3 = {
|
|
526
484
|
algodOptions?: AlgodClientOptions;
|
|
527
485
|
algosdkStatic?: typeof _algosdk;
|
|
528
486
|
network?: Network;
|
|
@@ -538,7 +496,7 @@ declare class AlgoSignerClient extends BaseClient {
|
|
|
538
496
|
icon: string;
|
|
539
497
|
isWalletConnect: boolean;
|
|
540
498
|
};
|
|
541
|
-
static init({ algodOptions, algosdkStatic, network, }: InitParams$
|
|
499
|
+
static init({ algodOptions, algosdkStatic, network, }: InitParams$3): Promise<AlgoSignerClient | null>;
|
|
542
500
|
connect(): Promise<{
|
|
543
501
|
accounts: {
|
|
544
502
|
name: string;
|
|
@@ -553,10 +511,6 @@ declare class AlgoSignerClient extends BaseClient {
|
|
|
553
511
|
reconnect(onDisconnect: () => void): Promise<null>;
|
|
554
512
|
disconnect(): Promise<void>;
|
|
555
513
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
556
|
-
/** @deprecated */
|
|
557
|
-
formatTransactionsArray(transactions: TransactionsArray): AlgoSignerTransaction[];
|
|
558
|
-
/** @deprecated */
|
|
559
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
560
514
|
}
|
|
561
515
|
|
|
562
516
|
interface IClientMeta {
|
|
@@ -582,7 +536,7 @@ interface IWalletConnectSession {
|
|
|
582
536
|
close: () => void;
|
|
583
537
|
};
|
|
584
538
|
}
|
|
585
|
-
declare type ClientOptions$
|
|
539
|
+
declare type ClientOptions$2 = {
|
|
586
540
|
bridge?: string;
|
|
587
541
|
uri?: string;
|
|
588
542
|
storageId?: string;
|
|
@@ -590,13 +544,8 @@ declare type ClientOptions$1 = {
|
|
|
590
544
|
session?: IWalletConnectSession;
|
|
591
545
|
clientMeta?: IClientMeta;
|
|
592
546
|
};
|
|
593
|
-
declare type
|
|
594
|
-
|
|
595
|
-
message?: string;
|
|
596
|
-
signers?: string[] | [];
|
|
597
|
-
};
|
|
598
|
-
declare type InitParams$1 = {
|
|
599
|
-
clientOptions?: ClientOptions$1;
|
|
547
|
+
declare type InitParams$2 = {
|
|
548
|
+
clientOptions?: ClientOptions$2;
|
|
600
549
|
algodOptions?: AlgodClientOptions;
|
|
601
550
|
clientStatic?: typeof WalletConnect;
|
|
602
551
|
modalStatic?: typeof QRCodeModal;
|
|
@@ -621,7 +570,7 @@ declare class WalletConnectClient extends BaseClient {
|
|
|
621
570
|
icon: string;
|
|
622
571
|
isWalletConnect: boolean;
|
|
623
572
|
};
|
|
624
|
-
static init({ clientOptions, algodOptions, clientStatic, modalStatic, algosdkStatic, network, }: InitParams$
|
|
573
|
+
static init({ clientOptions, algodOptions, clientStatic, modalStatic, algosdkStatic, network, }: InitParams$2): Promise<WalletConnectClient | null>;
|
|
625
574
|
connect(): Promise<Wallet>;
|
|
626
575
|
reconnect(): Promise<{
|
|
627
576
|
accounts: {
|
|
@@ -637,13 +586,9 @@ declare class WalletConnectClient extends BaseClient {
|
|
|
637
586
|
check(): boolean;
|
|
638
587
|
disconnect(): Promise<void>;
|
|
639
588
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
640
|
-
/** @deprecarted */
|
|
641
|
-
formatTransactionsArray(transactions: TransactionsArray): WalletConnectTransaction[];
|
|
642
|
-
/** @deprecated */
|
|
643
|
-
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
644
589
|
}
|
|
645
590
|
|
|
646
|
-
declare type ClientOptions = {
|
|
591
|
+
declare type ClientOptions$1 = {
|
|
647
592
|
wallet: string;
|
|
648
593
|
password: string;
|
|
649
594
|
host: string;
|
|
@@ -660,8 +605,8 @@ declare type KMDWalletClientConstructor = {
|
|
|
660
605
|
password: string;
|
|
661
606
|
network: Network;
|
|
662
607
|
};
|
|
663
|
-
declare type InitParams = {
|
|
664
|
-
clientOptions?: ClientOptions;
|
|
608
|
+
declare type InitParams$1 = {
|
|
609
|
+
clientOptions?: ClientOptions$1;
|
|
665
610
|
algodOptions?: AlgodClientOptions;
|
|
666
611
|
algosdkStatic?: typeof _algosdk;
|
|
667
612
|
network?: Network;
|
|
@@ -679,7 +624,7 @@ declare class KMDWalletClient extends BaseClient {
|
|
|
679
624
|
icon: string;
|
|
680
625
|
isWalletConnect: boolean;
|
|
681
626
|
};
|
|
682
|
-
static init({ clientOptions, algodOptions, algosdkStatic, network, }: InitParams): Promise<KMDWalletClient | null>;
|
|
627
|
+
static init({ clientOptions, algodOptions, algosdkStatic, network, }: InitParams$1): Promise<KMDWalletClient | null>;
|
|
683
628
|
connect(): Promise<Wallet>;
|
|
684
629
|
disconnect(): Promise<void>;
|
|
685
630
|
reconnect(): Promise<Wallet | null>;
|
|
@@ -688,8 +633,49 @@ declare class KMDWalletClient extends BaseClient {
|
|
|
688
633
|
releaseToken(token: string): Promise<void>;
|
|
689
634
|
listWallets(): Promise<Record<string, string>>;
|
|
690
635
|
listAccounts(wallet: string, password: string): Promise<Array<Account>>;
|
|
636
|
+
getWalletId(): Promise<string>;
|
|
637
|
+
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
declare type ClientOptions = {
|
|
641
|
+
wallet: string;
|
|
642
|
+
password: string;
|
|
643
|
+
host: string;
|
|
644
|
+
token: string;
|
|
645
|
+
port: string;
|
|
646
|
+
};
|
|
647
|
+
declare type MnemonicWalletClientConstructor = {
|
|
648
|
+
metadata: Metadata;
|
|
649
|
+
id: PROVIDER_ID;
|
|
650
|
+
algosdk: typeof _algosdk;
|
|
651
|
+
algodClient: _algosdk.Algodv2;
|
|
652
|
+
network: Network;
|
|
653
|
+
};
|
|
654
|
+
declare type InitParams = {
|
|
655
|
+
clientOptions?: ClientOptions;
|
|
656
|
+
algodOptions?: AlgodClientOptions;
|
|
657
|
+
algosdkStatic?: typeof _algosdk;
|
|
658
|
+
network?: Network;
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
declare class MnemonicWalletClient extends BaseClient {
|
|
662
|
+
#private;
|
|
663
|
+
id: PROVIDER_ID;
|
|
664
|
+
network: Network;
|
|
665
|
+
constructor({ metadata, id, algosdk, algodClient, network, }: MnemonicWalletClientConstructor);
|
|
666
|
+
static metadata: {
|
|
667
|
+
id: PROVIDER_ID;
|
|
668
|
+
name: string;
|
|
669
|
+
icon: string;
|
|
670
|
+
isWalletConnect: boolean;
|
|
671
|
+
};
|
|
672
|
+
static init({ algodOptions, algosdkStatic, network, }: InitParams): Promise<MnemonicWalletClient | null>;
|
|
673
|
+
connect(): Promise<Wallet>;
|
|
674
|
+
disconnect(): Promise<void>;
|
|
675
|
+
reconnect(): Promise<Wallet | null>;
|
|
676
|
+
requestPassword(): Promise<string>;
|
|
691
677
|
signTransactions(connectedAccounts: string[], transactions: Uint8Array[], indexesToSign?: number[], returnGroup?: boolean): Promise<Uint8Array[]>;
|
|
692
678
|
signEncodedTransactions(transactions: TransactionsArray): Promise<Uint8Array[]>;
|
|
693
679
|
}
|
|
694
680
|
|
|
695
|
-
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, 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.1
|
|
15
|
+
"version": "1.2.1",
|
|
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",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@blockshake/defly-connect": "^1.0.0",
|
|
81
81
|
"@json-rpc-tools/utils": "^1.7.6",
|
|
82
|
-
"@perawallet/connect": "^1.0
|
|
82
|
+
"@perawallet/connect": "^1.1.0",
|
|
83
83
|
"@randlabs/myalgo-connect": "^1.4.2",
|
|
84
84
|
"@walletconnect/client": "^1.8.0",
|
|
85
85
|
"algorand-walletconnect-qrcode-modal": "^1.8.0",
|