1 | import { SigningKey } from "../crypto/index.js";
|
2 | import { BaseWallet } from "./base-wallet.js";
|
3 | import { HDNodeWallet } from "./hdwallet.js";
|
4 | import type { ProgressCallback } from "../crypto/index.js";
|
5 | import type { Provider } from "../providers/index.js";
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export declare class Wallet extends BaseWallet {
|
17 | #private;
|
18 | |
19 |
|
20 |
|
21 |
|
22 | constructor(key: string | SigningKey, provider?: null | Provider);
|
23 | connect(provider: null | Provider): Wallet;
|
24 | /**
|
25 | * Resolves to a [JSON Keystore Wallet](json-wallets) encrypted with
|
26 | * %%password%%.
|
27 | *
|
28 | * If %%progressCallback%% is specified, it will receive periodic
|
29 | * updates as the encryption process progreses.
|
30 | */
|
31 | encrypt(password: Uint8Array | string, progressCallback?: ProgressCallback): Promise<string>;
|
32 | /**
|
33 | * Returns a [JSON Keystore Wallet](json-wallets) encryped with
|
34 | * %%password%%.
|
35 | *
|
36 | * It is preferred to use the [async version](encrypt) instead,
|
37 | * which allows a [[ProgressCallback]] to keep the user informed.
|
38 | *
|
39 | * This method will block the event loop (freezing all UI) until
|
40 | * it is complete, which may be a non-trivial duration.
|
41 | */
|
42 | encryptSync(password: Uint8Array | string): string;
|
43 | /**
|
44 | * Creates (asynchronously) a **Wallet** by decrypting the %%json%%
|
45 | * with %%password%%.
|
46 | *
|
47 | * If %%progress%% is provided, it is called periodically during
|
48 | * decryption so that any UI can be updated.
|
49 | */
|
50 | static fromEncryptedJson(json: string, password: Uint8Array | string, progress?: ProgressCallback): Promise<HDNodeWallet | Wallet>;
|
51 | /**
|
52 | * Creates a **Wallet** by decrypting the %%json%% with %%password%%.
|
53 | *
|
54 | * The [[fromEncryptedJson]] method is preferred, as this method
|
55 | * will lock up and freeze the UI during decryption, which may take
|
56 | * some time.
|
57 | */
|
58 | static fromEncryptedJsonSync(json: string, password: Uint8Array | string): HDNodeWallet | Wallet;
|
59 | /**
|
60 | * Creates a new random [[HDNodeWallet]] using the available
|
61 | * [cryptographic random source](randomBytes).
|
62 | *
|
63 | * If there is no crytographic random source, this will throw.
|
64 | */
|
65 | static createRandom(provider?: null | Provider): HDNodeWallet;
|
66 | /**
|
67 | * Creates a [[HDNodeWallet]] for %%phrase%%.
|
68 | */
|
69 | static fromPhrase(phrase: string, provider?: Provider): HDNodeWallet;
|
70 | }
|
71 | //# sourceMappingURL=wallet.d.ts.map |
\ | No newline at end of file |