1 | import type { EncryptedJsonEncoding, Keypair, KeypairType } from '@polkadot/util-crypto/types';
|
2 | import type { KeyringInstance, KeyringOptions, KeyringPair, KeyringPair$Json, KeyringPair$Meta } from './types.js';
|
3 | import { decodeAddress } from '@polkadot/util-crypto';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 | export declare class Keyring implements KeyringInstance {
|
21 | #private;
|
22 | decodeAddress: typeof decodeAddress;
|
23 | constructor(options?: KeyringOptions);
|
24 | /**
|
25 | * @description retrieve the pairs (alias for getPairs)
|
26 | */
|
27 | get pairs(): KeyringPair[];
|
28 | /**
|
29 | * @description retrieve the publicKeys (alias for getPublicKeys)
|
30 | */
|
31 | get publicKeys(): Uint8Array[];
|
32 | /**
|
33 | * @description Returns the type of the keyring, ed25519, sr25519 or ecdsa
|
34 | */
|
35 | get type(): KeypairType;
|
36 | /**
|
37 | * @name addPair
|
38 | * @summary Stores an account, given a keyring pair, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
39 | */
|
40 | addPair(pair: KeyringPair): KeyringPair;
|
41 | /**
|
42 | * @name addFromAddress
|
43 | * @summary Stores an account, given an account address, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
44 | * @description Allows user to explicitly provide separate inputs including account address or public key, and optionally
|
45 | * the associated account metadata, and the default encoded value as arguments (that may be obtained from the json file
|
46 | * of an account backup), and then generates a keyring pair from them that it passes to
|
47 | * `addPair` to stores in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
48 | */
|
49 | addFromAddress(address: string | Uint8Array, meta?: KeyringPair$Meta, encoded?: Uint8Array | null, type?: KeypairType, ignoreChecksum?: boolean, encType?: EncryptedJsonEncoding[]): KeyringPair;
|
50 | /**
|
51 | * @name addFromJson
|
52 | * @summary Stores an account, given JSON data, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
53 | * @description Allows user to provide a json object argument that contains account information (that may be obtained from the json file
|
54 | * of an account backup), and then generates a keyring pair from it that it passes to
|
55 | * `addPair` to stores in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
56 | */
|
57 | addFromJson(json: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
58 | /**
|
59 | * @name addFromMnemonic
|
60 | * @summary Stores an account, given a mnemonic, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
61 | * @description Allows user to provide a mnemonic (seed phrase that is provided when account is originally created)
|
62 | * argument and a metadata argument that contains account information (that may be obtained from the json file
|
63 | * of an account backup), and then generates a keyring pair from it that it passes to
|
64 | * `addPair` to stores in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
65 | */
|
66 | addFromMnemonic(mnemonic: string, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
67 | /**
|
68 | * @name addFromPair
|
69 | * @summary Stores an account created from an explicit publicKey/secreteKey combination
|
70 | */
|
71 | addFromPair(pair: Keypair, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
72 | /**
|
73 | * @name addFromSeed
|
74 | * @summary Stores an account, given seed data, as a Key/Value (public key, pair) in Keyring Pair Dictionary
|
75 | * @description Stores in a keyring pair dictionary the public key of the pair as a key and the pair as the associated value.
|
76 | * Allows user to provide the account seed as an argument, and then generates a keyring pair from it that it passes to
|
77 | * `addPair` to store in a keyring pair dictionary the public key of the generated pair as a key and the pair as the associated value.
|
78 | */
|
79 | addFromSeed(seed: Uint8Array, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
80 | /**
|
81 | * @name addFromUri
|
82 | * @summary Creates an account via an suri
|
83 | * @description Extracts the phrase, path and password from a SURI format for specifying secret keys `<secret>/<soft-key>//<hard-key>///<password>` (the `
|
84 | */
|
85 | addFromUri(suri: string, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
86 | |
87 |
|
88 |
|
89 |
|
90 | createFromJson({ address, encoded, encoding: { content, type, version }, meta }: KeyringPair$Json, ignoreChecksum?: boolean): KeyringPair;
|
91 | |
92 |
|
93 |
|
94 |
|
95 | createFromPair(pair: Keypair, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
96 | |
97 |
|
98 |
|
99 |
|
100 |
|
101 | createFromUri(_suri: string, meta?: KeyringPair$Meta, type?: KeypairType): KeyringPair;
|
102 | |
103 |
|
104 |
|
105 |
|
106 | encodeAddress: (address: Uint8Array | string, ss58Format?: number) => string;
|
107 | |
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 | getPair(address: string | Uint8Array): KeyringPair;
|
114 | |
115 |
|
116 |
|
117 |
|
118 |
|
119 | getPairs(): KeyringPair[];
|
120 | |
121 |
|
122 |
|
123 |
|
124 |
|
125 | getPublicKeys(): Uint8Array[];
|
126 | |
127 |
|
128 |
|
129 |
|
130 | removePair(address: string | Uint8Array): void;
|
131 | |
132 |
|
133 |
|
134 |
|
135 | setSS58Format(ss58: number): void;
|
136 | |
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 | toJson(address: string | Uint8Array, passphrase?: string): KeyringPair$Json;
|
145 | }
|
146 |
|
\ | No newline at end of file |