@trustwallet/wallet-core 3.1.4 → 3.1.5
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/lib/wallet-core.js +132 -128
- package/dist/lib/wallet-core.wasm +0 -0
- package/dist/src/wallet-core.d.ts +607 -607
- package/package.json +1 -1
@@ -6,28 +6,25 @@
|
|
6
6
|
//
|
7
7
|
// This is a GENERATED FILE, changes made here WILL BE LOST.
|
8
8
|
//
|
9
|
-
export namespace HexCoding {
|
10
|
-
export function decode(hex: string): Uint8Array;
|
11
|
-
export function encode(buffer: Uint8Array | Buffer): string;
|
12
|
-
}
|
13
9
|
export class AnySigner {
|
14
10
|
static sign(data: Uint8Array | Buffer, coin: CoinType): Uint8Array;
|
15
11
|
static plan(data: Uint8Array | Buffer, coin: CoinType): Uint8Array;
|
16
12
|
static supportsJSON(coin: CoinType): boolean;
|
17
13
|
}
|
18
|
-
export
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
static
|
24
|
-
static
|
25
|
-
static
|
26
|
-
static
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
static
|
14
|
+
export namespace HexCoding {
|
15
|
+
export function decode(hex: string): Uint8Array;
|
16
|
+
export function encode(buffer: Uint8Array | Buffer): string;
|
17
|
+
}
|
18
|
+
export class AES {
|
19
|
+
static encryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
20
|
+
static decryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
21
|
+
static encryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
22
|
+
static decryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
23
|
+
}
|
24
|
+
export class AESPaddingMode {
|
25
|
+
value: number;
|
26
|
+
static zero: AESPaddingMode;
|
27
|
+
static pkcs7: AESPaddingMode;
|
31
28
|
}
|
32
29
|
export class Account {
|
33
30
|
static create(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): Account;
|
@@ -39,190 +36,93 @@ export class Account {
|
|
39
36
|
coin(): CoinType;
|
40
37
|
delete(): void;
|
41
38
|
}
|
42
|
-
export class
|
43
|
-
|
44
|
-
static
|
45
|
-
static
|
46
|
-
static
|
47
|
-
static
|
48
|
-
|
49
|
-
|
50
|
-
static
|
51
|
-
static
|
52
|
-
static
|
53
|
-
static
|
39
|
+
export class AnyAddress {
|
40
|
+
static equal(lhs: AnyAddress, rhs: AnyAddress): boolean;
|
41
|
+
static isValid(string: string, coin: CoinType): boolean;
|
42
|
+
static isValidBech32(string: string, coin: CoinType, hrp: string): boolean;
|
43
|
+
static isValidSS58(string: string, coin: CoinType, ss58Prefix: number): boolean;
|
44
|
+
static createWithString(string: string, coin: CoinType): AnyAddress;
|
45
|
+
static createBech32(string: string, coin: CoinType, hrp: string): AnyAddress;
|
46
|
+
static createSS58(string: string, coin: CoinType, ss58Prefix: number): AnyAddress;
|
47
|
+
static createWithPublicKey(publicKey: PublicKey, coin: CoinType): AnyAddress;
|
48
|
+
static createWithPublicKeyDerivation(publicKey: PublicKey, coin: CoinType, derivation: Derivation): AnyAddress;
|
49
|
+
static createBech32WithPublicKey(publicKey: PublicKey, coin: CoinType, hrp: string): AnyAddress;
|
50
|
+
static createSS58WithPublicKey(publicKey: PublicKey, coin: CoinType, ss58Prefix: number): AnyAddress;
|
51
|
+
description(): string;
|
52
|
+
coin(): CoinType;
|
54
53
|
data(): Uint8Array;
|
55
|
-
getPublicKey(coinType: CoinType): PublicKey;
|
56
|
-
getPublicKeyByType(pubkeyType: PublicKeyType): PublicKey;
|
57
|
-
getPublicKeySecp256k1(compressed: boolean): PublicKey;
|
58
|
-
getPublicKeyNist256p1(): PublicKey;
|
59
|
-
getPublicKeyEd25519(): PublicKey;
|
60
|
-
getPublicKeyEd25519Blake2b(): PublicKey;
|
61
|
-
getPublicKeyEd25519Cardano(): PublicKey;
|
62
|
-
getPublicKeyCurve25519(): PublicKey;
|
63
|
-
getSharedKey(publicKey: PublicKey, curve: Curve): Uint8Array;
|
64
|
-
sign(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
65
|
-
signAsDER(digest: Uint8Array | Buffer): Uint8Array;
|
66
|
-
signZilliqaSchnorr(message: Uint8Array | Buffer): Uint8Array;
|
67
54
|
delete(): void;
|
68
55
|
}
|
69
|
-
export class
|
70
|
-
|
71
|
-
static
|
72
|
-
static
|
73
|
-
static
|
74
|
-
static bitcoinLegacy: Derivation;
|
75
|
-
static bitcoinTestnet: Derivation;
|
76
|
-
static litecoinLegacy: Derivation;
|
77
|
-
static solanaSolana: Derivation;
|
56
|
+
export class Base32 {
|
57
|
+
static decodeWithAlphabet(string: string, alphabet: string): Uint8Array;
|
58
|
+
static decode(string: string): Uint8Array;
|
59
|
+
static encodeWithAlphabet(data: Uint8Array | Buffer, alphabet: string): string;
|
60
|
+
static encode(data: Uint8Array | Buffer): string;
|
78
61
|
}
|
79
|
-
export class
|
80
|
-
static
|
81
|
-
static
|
82
|
-
static
|
83
|
-
static
|
84
|
-
static importHDWalletWithEncryption(mnemonic: string, name: string, password: Uint8Array | Buffer, coin: CoinType, encryption: StoredKeyEncryption): StoredKey;
|
85
|
-
static importJSON(json: Uint8Array | Buffer): StoredKey;
|
86
|
-
static createLevel(name: string, password: Uint8Array | Buffer, encryptionLevel: StoredKeyEncryptionLevel): StoredKey;
|
87
|
-
static createLevelAndEncryption(name: string, password: Uint8Array | Buffer, encryptionLevel: StoredKeyEncryptionLevel, encryption: StoredKeyEncryption): StoredKey;
|
88
|
-
static create(name: string, password: Uint8Array | Buffer): StoredKey;
|
89
|
-
static createEncryption(name: string, password: Uint8Array | Buffer, encryption: StoredKeyEncryption): StoredKey;
|
90
|
-
identifier(): string;
|
91
|
-
name(): string;
|
92
|
-
isMnemonic(): boolean;
|
93
|
-
accountCount(): number;
|
94
|
-
encryptionParameters(): string;
|
95
|
-
account(index: number): Account;
|
96
|
-
accountForCoin(coin: CoinType, wallet: HDWallet): Account;
|
97
|
-
accountForCoinDerivation(coin: CoinType, derivation: Derivation, wallet: HDWallet): Account;
|
98
|
-
addAccountDerivation(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
|
99
|
-
addAccount(address: string, coin: CoinType, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
|
100
|
-
removeAccountForCoin(coin: CoinType): void;
|
101
|
-
removeAccountForCoinDerivation(coin: CoinType, derivation: Derivation): void;
|
102
|
-
removeAccountForCoinDerivationPath(coin: CoinType, derivationPath: string): void;
|
103
|
-
store(path: string): boolean;
|
104
|
-
decryptPrivateKey(password: Uint8Array | Buffer): Uint8Array;
|
105
|
-
decryptMnemonic(password: Uint8Array | Buffer): string;
|
106
|
-
privateKey(coin: CoinType, password: Uint8Array | Buffer): PrivateKey;
|
107
|
-
wallet(password: Uint8Array | Buffer): HDWallet;
|
108
|
-
exportJSON(): Uint8Array;
|
109
|
-
fixAddresses(password: Uint8Array | Buffer): boolean;
|
110
|
-
delete(): void;
|
62
|
+
export class Base58 {
|
63
|
+
static encode(data: Uint8Array | Buffer): string;
|
64
|
+
static encodeNoCheck(data: Uint8Array | Buffer): string;
|
65
|
+
static decode(string: string): Uint8Array;
|
66
|
+
static decodeNoCheck(string: string): Uint8Array;
|
111
67
|
}
|
112
|
-
export class
|
113
|
-
static
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
addParamString(val: string, isOutput: boolean): number;
|
129
|
-
addParamAddress(val: Uint8Array | Buffer, isOutput: boolean): number;
|
130
|
-
addParamBytes(val: Uint8Array | Buffer, isOutput: boolean): number;
|
131
|
-
addParamBytesFix(size: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
132
|
-
addParamArray(isOutput: boolean): number;
|
133
|
-
getParamUInt8(idx: number, isOutput: boolean): number;
|
134
|
-
getParamUInt64(idx: number, isOutput: boolean): number;
|
135
|
-
getParamUInt256(idx: number, isOutput: boolean): Uint8Array;
|
136
|
-
getParamBool(idx: number, isOutput: boolean): boolean;
|
137
|
-
getParamString(idx: number, isOutput: boolean): string;
|
138
|
-
getParamAddress(idx: number, isOutput: boolean): Uint8Array;
|
139
|
-
addInArrayParamUInt8(arrayIdx: number, val: number): number;
|
140
|
-
addInArrayParamUInt16(arrayIdx: number, val: number): number;
|
141
|
-
addInArrayParamUInt32(arrayIdx: number, val: number): number;
|
142
|
-
addInArrayParamUInt64(arrayIdx: number, val: number): number;
|
143
|
-
addInArrayParamUInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
144
|
-
addInArrayParamUIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
145
|
-
addInArrayParamInt8(arrayIdx: number, val: number): number;
|
146
|
-
addInArrayParamInt16(arrayIdx: number, val: number): number;
|
147
|
-
addInArrayParamInt32(arrayIdx: number, val: number): number;
|
148
|
-
addInArrayParamInt64(arrayIdx: number, val: number): number;
|
149
|
-
addInArrayParamInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
150
|
-
addInArrayParamIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
151
|
-
addInArrayParamBool(arrayIdx: number, val: boolean): number;
|
152
|
-
addInArrayParamString(arrayIdx: number, val: string): number;
|
153
|
-
addInArrayParamAddress(arrayIdx: number, val: Uint8Array | Buffer): number;
|
154
|
-
addInArrayParamBytes(arrayIdx: number, val: Uint8Array | Buffer): number;
|
155
|
-
addInArrayParamBytesFix(arrayIdx: number, size: number, val: Uint8Array | Buffer): number;
|
68
|
+
export class Base64 {
|
69
|
+
static decode(string: string): Uint8Array;
|
70
|
+
static decodeUrl(string: string): Uint8Array;
|
71
|
+
static encode(data: Uint8Array | Buffer): string;
|
72
|
+
static encodeUrl(data: Uint8Array | Buffer): string;
|
73
|
+
}
|
74
|
+
export class BitcoinAddress {
|
75
|
+
static equal(lhs: BitcoinAddress, rhs: BitcoinAddress): boolean;
|
76
|
+
static isValid(data: Uint8Array | Buffer): boolean;
|
77
|
+
static isValidString(string: string): boolean;
|
78
|
+
static createWithString(string: string): BitcoinAddress;
|
79
|
+
static createWithData(data: Uint8Array | Buffer): BitcoinAddress;
|
80
|
+
static createWithPublicKey(publicKey: PublicKey, prefix: number): BitcoinAddress;
|
81
|
+
description(): string;
|
82
|
+
prefix(): number;
|
83
|
+
keyhash(): Uint8Array;
|
156
84
|
delete(): void;
|
157
85
|
}
|
158
|
-
export class
|
159
|
-
|
160
|
-
static
|
161
|
-
static ed25519: Curve;
|
162
|
-
static ed25519Blake2bNano: Curve;
|
163
|
-
static curve25519: Curve;
|
164
|
-
static nist256p1: Curve;
|
165
|
-
static ed25519ExtendedCardano: Curve;
|
86
|
+
export class BitcoinMessageSigner {
|
87
|
+
static signMessage(privateKey: PrivateKey, address: string, message: string): string;
|
88
|
+
static verifyMessage(address: string, message: string, signature: string): boolean;
|
166
89
|
}
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
static
|
172
|
-
static
|
173
|
-
static
|
174
|
-
static
|
175
|
-
static
|
176
|
-
static
|
90
|
+
export class BitcoinScript {
|
91
|
+
static equal(lhs: BitcoinScript, rhs: BitcoinScript): boolean;
|
92
|
+
static buildPayToPublicKey(pubkey: Uint8Array | Buffer): BitcoinScript;
|
93
|
+
static buildPayToPublicKeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
94
|
+
static buildPayToScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
95
|
+
static buildPayToWitnessPubkeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
96
|
+
static buildPayToWitnessScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
97
|
+
static lockScriptForAddress(address: string, coin: CoinType): BitcoinScript;
|
98
|
+
static hashTypeForCoin(coinType: CoinType): number;
|
99
|
+
static create(): BitcoinScript;
|
100
|
+
static createWithData(data: Uint8Array | Buffer): BitcoinScript;
|
101
|
+
static createCopy(script: BitcoinScript): BitcoinScript;
|
102
|
+
size(): number;
|
103
|
+
data(): Uint8Array;
|
104
|
+
scriptHash(): Uint8Array;
|
105
|
+
isPayToScriptHash(): boolean;
|
106
|
+
isPayToWitnessScriptHash(): boolean;
|
107
|
+
isPayToWitnessPublicKeyHash(): boolean;
|
108
|
+
isWitnessProgram(): boolean;
|
109
|
+
matchPayToPubkey(): Uint8Array;
|
110
|
+
matchPayToPubkeyHash(): Uint8Array;
|
111
|
+
matchPayToScriptHash(): Uint8Array;
|
112
|
+
matchPayToWitnessPublicKeyHash(): Uint8Array;
|
113
|
+
matchPayToWitnessScriptHash(): Uint8Array;
|
114
|
+
encode(): Uint8Array;
|
115
|
+
delete(): void;
|
177
116
|
}
|
178
|
-
export class
|
117
|
+
export class BitcoinSigHashType {
|
179
118
|
value: number;
|
180
|
-
static
|
181
|
-
static
|
182
|
-
static
|
183
|
-
static
|
184
|
-
static
|
119
|
+
static all: BitcoinSigHashType;
|
120
|
+
static none: BitcoinSigHashType;
|
121
|
+
static single: BitcoinSigHashType;
|
122
|
+
static fork: BitcoinSigHashType;
|
123
|
+
static forkBTG: BitcoinSigHashType;
|
185
124
|
}
|
186
|
-
export class
|
187
|
-
value: number;
|
188
|
-
static unknown: HRP;
|
189
|
-
static bitcoin: HRP;
|
190
|
-
static litecoin: HRP;
|
191
|
-
static viacoin: HRP;
|
192
|
-
static groestlcoin: HRP;
|
193
|
-
static digiByte: HRP;
|
194
|
-
static monacoin: HRP;
|
195
|
-
static cosmos: HRP;
|
196
|
-
static bitcoinCash: HRP;
|
197
|
-
static bitcoinGold: HRP;
|
198
|
-
static ioTeX: HRP;
|
199
|
-
static nervos: HRP;
|
200
|
-
static zilliqa: HRP;
|
201
|
-
static terra: HRP;
|
202
|
-
static cryptoOrg: HRP;
|
203
|
-
static kava: HRP;
|
204
|
-
static oasis: HRP;
|
205
|
-
static bluzelle: HRP;
|
206
|
-
static bandChain: HRP;
|
207
|
-
static elrond: HRP;
|
208
|
-
static binance: HRP;
|
209
|
-
static ecash: HRP;
|
210
|
-
static thorchain: HRP;
|
211
|
-
static harmony: HRP;
|
212
|
-
static cardano: HRP;
|
213
|
-
static qtum: HRP;
|
214
|
-
static osmosis: HRP;
|
215
|
-
static terraV2: HRP;
|
216
|
-
static nativeEvmos: HRP;
|
217
|
-
}
|
218
|
-
|
219
|
-
declare function describeHRP(value: HRP): string;
|
220
|
-
|
221
|
-
export class PBKDF2 {
|
222
|
-
static hmacSha256(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
223
|
-
static hmacSha512(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
224
|
-
}
|
225
|
-
export class Blockchain {
|
125
|
+
export class Blockchain {
|
226
126
|
value: number;
|
227
127
|
static bitcoin: Blockchain;
|
228
128
|
static ethereum: Blockchain;
|
@@ -268,225 +168,279 @@ export class Blockchain {
|
|
268
168
|
static aptos: Blockchain;
|
269
169
|
static hedera: Blockchain;
|
270
170
|
}
|
271
|
-
export class
|
272
|
-
|
273
|
-
static
|
274
|
-
static pkcs7: AESPaddingMode;
|
275
|
-
}
|
276
|
-
export class THORChainSwap {
|
277
|
-
static buildSwap(input: Uint8Array | Buffer): Uint8Array;
|
278
|
-
}
|
279
|
-
export class HDWallet {
|
280
|
-
static getPublicKeyFromExtended(extended: string, coin: CoinType, derivationPath: string): PublicKey;
|
281
|
-
static create(strength: number, passphrase: string): HDWallet;
|
282
|
-
static createWithMnemonic(mnemonic: string, passphrase: string): HDWallet;
|
283
|
-
static createWithMnemonicCheck(mnemonic: string, passphrase: string, check: boolean): HDWallet;
|
284
|
-
static createWithEntropy(entropy: Uint8Array | Buffer, passphrase: string): HDWallet;
|
285
|
-
seed(): Uint8Array;
|
286
|
-
mnemonic(): string;
|
287
|
-
entropy(): Uint8Array;
|
288
|
-
getMasterKey(curve: Curve): PrivateKey;
|
289
|
-
getKeyForCoin(coin: CoinType): PrivateKey;
|
290
|
-
getAddressForCoin(coin: CoinType): string;
|
291
|
-
getAddressDerivation(coin: CoinType, derivation: Derivation): string;
|
292
|
-
getKey(coin: CoinType, derivationPath: string): PrivateKey;
|
293
|
-
getKeyDerivation(coin: CoinType, derivation: Derivation): PrivateKey;
|
294
|
-
getKeyByCurve(curve: Curve, derivationPath: string): PrivateKey;
|
295
|
-
getDerivedKey(coin: CoinType, account: number, change: number, address: number): PrivateKey;
|
296
|
-
getExtendedPrivateKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
297
|
-
getExtendedPublicKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
298
|
-
getExtendedPrivateKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
299
|
-
getExtendedPublicKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
300
|
-
getExtendedPrivateKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
301
|
-
getExtendedPublicKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
302
|
-
delete(): void;
|
171
|
+
export class Cardano {
|
172
|
+
static minAdaAmount(tokenBundle: Uint8Array | Buffer): number;
|
173
|
+
static getStakingAddress(baseAddress: string): string;
|
303
174
|
}
|
304
|
-
export class
|
175
|
+
export class CoinType {
|
305
176
|
value: number;
|
306
|
-
static
|
307
|
-
static
|
308
|
-
|
309
|
-
|
310
|
-
static
|
311
|
-
static
|
312
|
-
static
|
177
|
+
static aeternity: CoinType;
|
178
|
+
static aion: CoinType;
|
179
|
+
static binance: CoinType;
|
180
|
+
static bitcoin: CoinType;
|
181
|
+
static bitcoinCash: CoinType;
|
182
|
+
static bitcoinGold: CoinType;
|
183
|
+
static callisto: CoinType;
|
184
|
+
static cardano: CoinType;
|
185
|
+
static cosmos: CoinType;
|
186
|
+
static dash: CoinType;
|
187
|
+
static decred: CoinType;
|
188
|
+
static digiByte: CoinType;
|
189
|
+
static dogecoin: CoinType;
|
190
|
+
static eos: CoinType;
|
191
|
+
static ethereum: CoinType;
|
192
|
+
static ethereumClassic: CoinType;
|
193
|
+
static fio: CoinType;
|
194
|
+
static goChain: CoinType;
|
195
|
+
static groestlcoin: CoinType;
|
196
|
+
static icon: CoinType;
|
197
|
+
static ioTeX: CoinType;
|
198
|
+
static kava: CoinType;
|
199
|
+
static kin: CoinType;
|
200
|
+
static litecoin: CoinType;
|
201
|
+
static monacoin: CoinType;
|
202
|
+
static nebulas: CoinType;
|
203
|
+
static nuls: CoinType;
|
204
|
+
static nano: CoinType;
|
205
|
+
static near: CoinType;
|
206
|
+
static nimiq: CoinType;
|
207
|
+
static ontology: CoinType;
|
208
|
+
static poanetwork: CoinType;
|
209
|
+
static qtum: CoinType;
|
210
|
+
static xrp: CoinType;
|
211
|
+
static solana: CoinType;
|
212
|
+
static stellar: CoinType;
|
213
|
+
static tezos: CoinType;
|
214
|
+
static theta: CoinType;
|
215
|
+
static thunderToken: CoinType;
|
216
|
+
static neo: CoinType;
|
217
|
+
static tomoChain: CoinType;
|
218
|
+
static tron: CoinType;
|
219
|
+
static veChain: CoinType;
|
220
|
+
static viacoin: CoinType;
|
221
|
+
static wanchain: CoinType;
|
222
|
+
static zcash: CoinType;
|
223
|
+
static firo: CoinType;
|
224
|
+
static zilliqa: CoinType;
|
225
|
+
static zelcash: CoinType;
|
226
|
+
static ravencoin: CoinType;
|
227
|
+
static waves: CoinType;
|
228
|
+
static terra: CoinType;
|
229
|
+
static terraV2: CoinType;
|
230
|
+
static harmony: CoinType;
|
231
|
+
static algorand: CoinType;
|
232
|
+
static kusama: CoinType;
|
233
|
+
static polkadot: CoinType;
|
234
|
+
static filecoin: CoinType;
|
235
|
+
static elrond: CoinType;
|
236
|
+
static bandChain: CoinType;
|
237
|
+
static smartChainLegacy: CoinType;
|
238
|
+
static smartChain: CoinType;
|
239
|
+
static oasis: CoinType;
|
240
|
+
static polygon: CoinType;
|
241
|
+
static thorchain: CoinType;
|
242
|
+
static bluzelle: CoinType;
|
243
|
+
static optimism: CoinType;
|
244
|
+
static zksync: CoinType;
|
245
|
+
static arbitrum: CoinType;
|
246
|
+
static ecochain: CoinType;
|
247
|
+
static avalancheCChain: CoinType;
|
248
|
+
static xdai: CoinType;
|
249
|
+
static fantom: CoinType;
|
250
|
+
static cryptoOrg: CoinType;
|
251
|
+
static celo: CoinType;
|
252
|
+
static ronin: CoinType;
|
253
|
+
static osmosis: CoinType;
|
254
|
+
static ecash: CoinType;
|
255
|
+
static cronosChain: CoinType;
|
256
|
+
static smartBitcoinCash: CoinType;
|
257
|
+
static kuCoinCommunityChain: CoinType;
|
258
|
+
static boba: CoinType;
|
259
|
+
static metis: CoinType;
|
260
|
+
static aurora: CoinType;
|
261
|
+
static evmos: CoinType;
|
262
|
+
static nativeEvmos: CoinType;
|
263
|
+
static moonriver: CoinType;
|
264
|
+
static moonbeam: CoinType;
|
265
|
+
static kavaEvm: CoinType;
|
266
|
+
static klaytn: CoinType;
|
267
|
+
static meter: CoinType;
|
268
|
+
static okxchain: CoinType;
|
269
|
+
static nervos: CoinType;
|
270
|
+
static everscale: CoinType;
|
271
|
+
static aptos: CoinType;
|
272
|
+
static hedera: CoinType;
|
313
273
|
}
|
314
|
-
export class
|
315
|
-
static
|
316
|
-
static
|
317
|
-
static
|
318
|
-
static
|
274
|
+
export class CoinTypeConfiguration {
|
275
|
+
static getSymbol(type: CoinType): string;
|
276
|
+
static getDecimals(type: CoinType): number;
|
277
|
+
static getTransactionURL(type: CoinType, transactionID: string): string;
|
278
|
+
static getAccountURL(type: CoinType, accountID: string): string;
|
279
|
+
static getID(type: CoinType): string;
|
280
|
+
static getName(type: CoinType): string;
|
319
281
|
}
|
320
|
-
export class
|
282
|
+
export class Curve {
|
321
283
|
value: number;
|
322
|
-
static
|
323
|
-
static
|
324
|
-
static
|
325
|
-
static
|
284
|
+
static secp256k1: Curve;
|
285
|
+
static ed25519: Curve;
|
286
|
+
static ed25519Blake2bNano: Curve;
|
287
|
+
static curve25519: Curve;
|
288
|
+
static nist256p1: Curve;
|
289
|
+
static ed25519ExtendedCardano: Curve;
|
326
290
|
}
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
static
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
291
|
+
|
292
|
+
declare function describeCurve(value: Curve): string;
|
293
|
+
|
294
|
+
export class DataVector {
|
295
|
+
static create(): DataVector;
|
296
|
+
static createWithData(data: Uint8Array | Buffer): DataVector;
|
297
|
+
size(): number;
|
298
|
+
add(data: Uint8Array | Buffer): void;
|
299
|
+
get(index: number): Uint8Array;
|
336
300
|
delete(): void;
|
337
301
|
}
|
338
|
-
export class
|
302
|
+
export class Derivation {
|
339
303
|
value: number;
|
340
|
-
static
|
341
|
-
static
|
342
|
-
static
|
343
|
-
static
|
304
|
+
static default: Derivation;
|
305
|
+
static custom: Derivation;
|
306
|
+
static bitcoinSegwit: Derivation;
|
307
|
+
static bitcoinLegacy: Derivation;
|
308
|
+
static bitcoinTestnet: Derivation;
|
309
|
+
static litecoinLegacy: Derivation;
|
310
|
+
static solanaSolana: Derivation;
|
344
311
|
}
|
345
|
-
export class
|
346
|
-
static
|
347
|
-
static
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
static createWithPublicKey(publicKey: PublicKey, coin: CoinType): AnyAddress;
|
354
|
-
static createWithPublicKeyDerivation(publicKey: PublicKey, coin: CoinType, derivation: Derivation): AnyAddress;
|
355
|
-
static createBech32WithPublicKey(publicKey: PublicKey, coin: CoinType, hrp: string): AnyAddress;
|
356
|
-
static createSS58WithPublicKey(publicKey: PublicKey, coin: CoinType, ss58Prefix: number): AnyAddress;
|
312
|
+
export class DerivationPath {
|
313
|
+
static create(purpose: Purpose, coin: number, account: number, change: number, address: number): DerivationPath;
|
314
|
+
static createWithString(string: string): DerivationPath;
|
315
|
+
purpose(): Purpose;
|
316
|
+
coin(): number;
|
317
|
+
account(): number;
|
318
|
+
change(): number;
|
319
|
+
address(): number;
|
357
320
|
description(): string;
|
358
|
-
|
359
|
-
|
321
|
+
indexAt(index: number): DerivationPathIndex;
|
322
|
+
indicesCount(): number;
|
360
323
|
delete(): void;
|
361
324
|
}
|
362
|
-
export class
|
363
|
-
static
|
364
|
-
|
365
|
-
|
366
|
-
static createWithPublicKey(publicKey: PublicKey, prefix: number): GroestlcoinAddress;
|
325
|
+
export class DerivationPathIndex {
|
326
|
+
static create(value: number, hardened: boolean): DerivationPathIndex;
|
327
|
+
value(): number;
|
328
|
+
hardened(): boolean;
|
367
329
|
description(): string;
|
368
330
|
delete(): void;
|
369
331
|
}
|
370
|
-
export class
|
371
|
-
static
|
372
|
-
static
|
373
|
-
static
|
374
|
-
static
|
375
|
-
description(): string;
|
376
|
-
tag(): number;
|
377
|
-
delete(): void;
|
378
|
-
}
|
379
|
-
export class SolanaAddress {
|
380
|
-
static createWithString(string: string): SolanaAddress;
|
381
|
-
description(): string;
|
382
|
-
defaultTokenAddress(tokenMintAddress: string): string;
|
383
|
-
delete(): void;
|
384
|
-
}
|
385
|
-
export class PublicKey {
|
386
|
-
static isValid(data: Uint8Array | Buffer, type: PublicKeyType): boolean;
|
387
|
-
static recover(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): PublicKey;
|
388
|
-
static createWithData(data: Uint8Array | Buffer, type: PublicKeyType): PublicKey;
|
389
|
-
isCompressed(): boolean;
|
390
|
-
compressed(): PublicKey;
|
391
|
-
uncompressed(): PublicKey;
|
392
|
-
data(): Uint8Array;
|
393
|
-
keyType(): PublicKeyType;
|
394
|
-
description(): string;
|
395
|
-
verify(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
396
|
-
verifyAsDER(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
397
|
-
verifyZilliqaSchnorr(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
398
|
-
delete(): void;
|
399
|
-
}
|
400
|
-
export class BitcoinSigHashType {
|
401
|
-
value: number;
|
402
|
-
static all: BitcoinSigHashType;
|
403
|
-
static none: BitcoinSigHashType;
|
404
|
-
static single: BitcoinSigHashType;
|
405
|
-
static fork: BitcoinSigHashType;
|
406
|
-
static forkBTG: BitcoinSigHashType;
|
407
|
-
}
|
408
|
-
export class Cardano {
|
409
|
-
static minAdaAmount(tokenBundle: Uint8Array | Buffer): number;
|
410
|
-
static getStakingAddress(baseAddress: string): string;
|
332
|
+
export class EthereumAbi {
|
333
|
+
static encode(fn: EthereumAbiFunction): Uint8Array;
|
334
|
+
static decodeOutput(fn: EthereumAbiFunction, encoded: Uint8Array | Buffer): boolean;
|
335
|
+
static decodeCall(data: Uint8Array | Buffer, abi: string): string;
|
336
|
+
static encodeTyped(messageJson: string): Uint8Array;
|
411
337
|
}
|
412
|
-
export class
|
413
|
-
static
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
338
|
+
export class EthereumAbiFunction {
|
339
|
+
static createWithString(name: string): EthereumAbiFunction;
|
340
|
+
getType(): string;
|
341
|
+
addParamUInt8(val: number, isOutput: boolean): number;
|
342
|
+
addParamUInt16(val: number, isOutput: boolean): number;
|
343
|
+
addParamUInt32(val: number, isOutput: boolean): number;
|
344
|
+
addParamUInt64(val: number, isOutput: boolean): number;
|
345
|
+
addParamUInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
|
346
|
+
addParamUIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
347
|
+
addParamInt8(val: number, isOutput: boolean): number;
|
348
|
+
addParamInt16(val: number, isOutput: boolean): number;
|
349
|
+
addParamInt32(val: number, isOutput: boolean): number;
|
350
|
+
addParamInt64(val: number, isOutput: boolean): number;
|
351
|
+
addParamInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
|
352
|
+
addParamIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
353
|
+
addParamBool(val: boolean, isOutput: boolean): number;
|
354
|
+
addParamString(val: string, isOutput: boolean): number;
|
355
|
+
addParamAddress(val: Uint8Array | Buffer, isOutput: boolean): number;
|
356
|
+
addParamBytes(val: Uint8Array | Buffer, isOutput: boolean): number;
|
357
|
+
addParamBytesFix(size: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
358
|
+
addParamArray(isOutput: boolean): number;
|
359
|
+
getParamUInt8(idx: number, isOutput: boolean): number;
|
360
|
+
getParamUInt64(idx: number, isOutput: boolean): number;
|
361
|
+
getParamUInt256(idx: number, isOutput: boolean): Uint8Array;
|
362
|
+
getParamBool(idx: number, isOutput: boolean): boolean;
|
363
|
+
getParamString(idx: number, isOutput: boolean): string;
|
364
|
+
getParamAddress(idx: number, isOutput: boolean): Uint8Array;
|
365
|
+
addInArrayParamUInt8(arrayIdx: number, val: number): number;
|
366
|
+
addInArrayParamUInt16(arrayIdx: number, val: number): number;
|
367
|
+
addInArrayParamUInt32(arrayIdx: number, val: number): number;
|
368
|
+
addInArrayParamUInt64(arrayIdx: number, val: number): number;
|
369
|
+
addInArrayParamUInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
370
|
+
addInArrayParamUIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
371
|
+
addInArrayParamInt8(arrayIdx: number, val: number): number;
|
372
|
+
addInArrayParamInt16(arrayIdx: number, val: number): number;
|
373
|
+
addInArrayParamInt32(arrayIdx: number, val: number): number;
|
374
|
+
addInArrayParamInt64(arrayIdx: number, val: number): number;
|
375
|
+
addInArrayParamInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
376
|
+
addInArrayParamIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
377
|
+
addInArrayParamBool(arrayIdx: number, val: boolean): number;
|
378
|
+
addInArrayParamString(arrayIdx: number, val: string): number;
|
379
|
+
addInArrayParamAddress(arrayIdx: number, val: Uint8Array | Buffer): number;
|
380
|
+
addInArrayParamBytes(arrayIdx: number, val: Uint8Array | Buffer): number;
|
381
|
+
addInArrayParamBytesFix(arrayIdx: number, size: number, val: Uint8Array | Buffer): number;
|
422
382
|
delete(): void;
|
423
383
|
}
|
424
|
-
export class
|
425
|
-
value:
|
426
|
-
static
|
427
|
-
static
|
428
|
-
static
|
429
|
-
static
|
430
|
-
static
|
431
|
-
static
|
432
|
-
static
|
433
|
-
static
|
384
|
+
export class EthereumAbiValue {
|
385
|
+
static encodeBool(value: boolean): Uint8Array;
|
386
|
+
static encodeInt32(value: number): Uint8Array;
|
387
|
+
static encodeUInt32(value: number): Uint8Array;
|
388
|
+
static encodeInt256(value: Uint8Array | Buffer): Uint8Array;
|
389
|
+
static encodeUInt256(value: Uint8Array | Buffer): Uint8Array;
|
390
|
+
static encodeAddress(value: Uint8Array | Buffer): Uint8Array;
|
391
|
+
static encodeString(value: string): Uint8Array;
|
392
|
+
static encodeBytes(value: Uint8Array | Buffer): Uint8Array;
|
393
|
+
static encodeBytesDyn(value: Uint8Array | Buffer): Uint8Array;
|
394
|
+
static decodeUInt256(input: Uint8Array | Buffer): string;
|
395
|
+
static decodeValue(input: Uint8Array | Buffer, type: string): string;
|
396
|
+
static decodeArray(input: Uint8Array | Buffer, type: string): string;
|
434
397
|
}
|
435
|
-
export class
|
398
|
+
export class EthereumChainID {
|
436
399
|
value: number;
|
437
|
-
static
|
438
|
-
static
|
439
|
-
static
|
440
|
-
static
|
441
|
-
|
442
|
-
|
443
|
-
static
|
444
|
-
static
|
445
|
-
static
|
446
|
-
static
|
447
|
-
|
448
|
-
|
449
|
-
static
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
400
|
+
static ethereum: EthereumChainID;
|
401
|
+
static classic: EthereumChainID;
|
402
|
+
static poa: EthereumChainID;
|
403
|
+
static vechain: EthereumChainID;
|
404
|
+
static callisto: EthereumChainID;
|
405
|
+
static tomochain: EthereumChainID;
|
406
|
+
static polygon: EthereumChainID;
|
407
|
+
static okc: EthereumChainID;
|
408
|
+
static thundertoken: EthereumChainID;
|
409
|
+
static gochain: EthereumChainID;
|
410
|
+
static meter: EthereumChainID;
|
411
|
+
static celo: EthereumChainID;
|
412
|
+
static wanchain: EthereumChainID;
|
413
|
+
static cronos: EthereumChainID;
|
414
|
+
static optimism: EthereumChainID;
|
415
|
+
static xdai: EthereumChainID;
|
416
|
+
static smartbch: EthereumChainID;
|
417
|
+
static fantom: EthereumChainID;
|
418
|
+
static zksync: EthereumChainID;
|
419
|
+
static boba: EthereumChainID;
|
420
|
+
static kcc: EthereumChainID;
|
421
|
+
static heco: EthereumChainID;
|
422
|
+
static metis: EthereumChainID;
|
423
|
+
static moonbeam: EthereumChainID;
|
424
|
+
static moonriver: EthereumChainID;
|
425
|
+
static ronin: EthereumChainID;
|
426
|
+
static kavaevm: EthereumChainID;
|
427
|
+
static klaytn: EthereumChainID;
|
428
|
+
static avalanchec: EthereumChainID;
|
429
|
+
static evmos: EthereumChainID;
|
430
|
+
static arbitrum: EthereumChainID;
|
431
|
+
static smartchain: EthereumChainID;
|
432
|
+
static aurora: EthereumChainID;
|
454
433
|
}
|
455
434
|
export class FIOAccount {
|
456
435
|
static createWithString(string: string): FIOAccount;
|
457
436
|
description(): string;
|
458
437
|
delete(): void;
|
459
438
|
}
|
460
|
-
export class
|
461
|
-
static
|
462
|
-
static
|
463
|
-
static
|
464
|
-
static
|
465
|
-
}
|
466
|
-
export class Mnemonic {
|
467
|
-
static isValid(mnemonic: string): boolean;
|
468
|
-
static isValidWord(word: string): boolean;
|
469
|
-
static suggest(prefix: string): string;
|
470
|
-
}
|
471
|
-
export class DerivationPath {
|
472
|
-
static create(purpose: Purpose, coin: number, account: number, change: number, address: number): DerivationPath;
|
473
|
-
static createWithString(string: string): DerivationPath;
|
474
|
-
purpose(): Purpose;
|
475
|
-
coin(): number;
|
476
|
-
account(): number;
|
477
|
-
change(): number;
|
478
|
-
address(): number;
|
479
|
-
description(): string;
|
480
|
-
indexAt(index: number): DerivationPathIndex;
|
481
|
-
indicesCount(): number;
|
482
|
-
delete(): void;
|
483
|
-
}
|
484
|
-
export class BitcoinMessageSigner {
|
485
|
-
static signMessage(privateKey: PrivateKey, address: string, message: string): string;
|
486
|
-
static verifyMessage(address: string, message: string, signature: string): boolean;
|
487
|
-
}
|
488
|
-
export class NEARAccount {
|
489
|
-
static createWithString(string: string): NEARAccount;
|
439
|
+
export class GroestlcoinAddress {
|
440
|
+
static equal(lhs: GroestlcoinAddress, rhs: GroestlcoinAddress): boolean;
|
441
|
+
static isValidString(string: string): boolean;
|
442
|
+
static createWithString(string: string): GroestlcoinAddress;
|
443
|
+
static createWithPublicKey(publicKey: PublicKey, prefix: number): GroestlcoinAddress;
|
490
444
|
description(): string;
|
491
445
|
delete(): void;
|
492
446
|
}
|
@@ -508,51 +462,65 @@ export class HDVersion {
|
|
508
462
|
static dgub: HDVersion;
|
509
463
|
static dgpv: HDVersion;
|
510
464
|
}
|
511
|
-
export class
|
512
|
-
static
|
513
|
-
static
|
514
|
-
static
|
515
|
-
static
|
465
|
+
export class HDWallet {
|
466
|
+
static getPublicKeyFromExtended(extended: string, coin: CoinType, derivationPath: string): PublicKey;
|
467
|
+
static create(strength: number, passphrase: string): HDWallet;
|
468
|
+
static createWithMnemonic(mnemonic: string, passphrase: string): HDWallet;
|
469
|
+
static createWithMnemonicCheck(mnemonic: string, passphrase: string, check: boolean): HDWallet;
|
470
|
+
static createWithEntropy(entropy: Uint8Array | Buffer, passphrase: string): HDWallet;
|
471
|
+
seed(): Uint8Array;
|
472
|
+
mnemonic(): string;
|
473
|
+
entropy(): Uint8Array;
|
474
|
+
getMasterKey(curve: Curve): PrivateKey;
|
475
|
+
getKeyForCoin(coin: CoinType): PrivateKey;
|
476
|
+
getAddressForCoin(coin: CoinType): string;
|
477
|
+
getAddressDerivation(coin: CoinType, derivation: Derivation): string;
|
478
|
+
getKey(coin: CoinType, derivationPath: string): PrivateKey;
|
479
|
+
getKeyDerivation(coin: CoinType, derivation: Derivation): PrivateKey;
|
480
|
+
getKeyByCurve(curve: Curve, derivationPath: string): PrivateKey;
|
481
|
+
getDerivedKey(coin: CoinType, account: number, change: number, address: number): PrivateKey;
|
482
|
+
getExtendedPrivateKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
483
|
+
getExtendedPublicKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
484
|
+
getExtendedPrivateKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
485
|
+
getExtendedPublicKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
486
|
+
getExtendedPrivateKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
487
|
+
getExtendedPublicKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
488
|
+
delete(): void;
|
516
489
|
}
|
517
|
-
export class
|
518
|
-
static equal(lhs: BitcoinScript, rhs: BitcoinScript): boolean;
|
519
|
-
static buildPayToPublicKey(pubkey: Uint8Array | Buffer): BitcoinScript;
|
520
|
-
static buildPayToPublicKeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
521
|
-
static buildPayToScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
522
|
-
static buildPayToWitnessPubkeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
523
|
-
static buildPayToWitnessScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
524
|
-
static lockScriptForAddress(address: string, coin: CoinType): BitcoinScript;
|
525
|
-
static hashTypeForCoin(coinType: CoinType): number;
|
526
|
-
static create(): BitcoinScript;
|
527
|
-
static createWithData(data: Uint8Array | Buffer): BitcoinScript;
|
528
|
-
static createCopy(script: BitcoinScript): BitcoinScript;
|
529
|
-
size(): number;
|
530
|
-
data(): Uint8Array;
|
531
|
-
scriptHash(): Uint8Array;
|
532
|
-
isPayToScriptHash(): boolean;
|
533
|
-
isPayToWitnessScriptHash(): boolean;
|
534
|
-
isPayToWitnessPublicKeyHash(): boolean;
|
535
|
-
isWitnessProgram(): boolean;
|
536
|
-
matchPayToPubkey(): Uint8Array;
|
537
|
-
matchPayToPubkeyHash(): Uint8Array;
|
538
|
-
matchPayToScriptHash(): Uint8Array;
|
539
|
-
matchPayToWitnessPublicKeyHash(): Uint8Array;
|
540
|
-
matchPayToWitnessScriptHash(): Uint8Array;
|
541
|
-
encode(): Uint8Array;
|
542
|
-
delete(): void;
|
543
|
-
}
|
544
|
-
export class SS58AddressType {
|
545
|
-
value: number;
|
546
|
-
static polkadot: SS58AddressType;
|
547
|
-
static kusama: SS58AddressType;
|
548
|
-
}
|
549
|
-
export class StellarPassphrase {
|
490
|
+
export class HRP {
|
550
491
|
value: number;
|
551
|
-
static
|
552
|
-
static
|
492
|
+
static unknown: HRP;
|
493
|
+
static bitcoin: HRP;
|
494
|
+
static litecoin: HRP;
|
495
|
+
static viacoin: HRP;
|
496
|
+
static groestlcoin: HRP;
|
497
|
+
static digiByte: HRP;
|
498
|
+
static monacoin: HRP;
|
499
|
+
static cosmos: HRP;
|
500
|
+
static bitcoinCash: HRP;
|
501
|
+
static bitcoinGold: HRP;
|
502
|
+
static ioTeX: HRP;
|
503
|
+
static nervos: HRP;
|
504
|
+
static zilliqa: HRP;
|
505
|
+
static terra: HRP;
|
506
|
+
static cryptoOrg: HRP;
|
507
|
+
static kava: HRP;
|
508
|
+
static oasis: HRP;
|
509
|
+
static bluzelle: HRP;
|
510
|
+
static bandChain: HRP;
|
511
|
+
static elrond: HRP;
|
512
|
+
static binance: HRP;
|
513
|
+
static ecash: HRP;
|
514
|
+
static thorchain: HRP;
|
515
|
+
static harmony: HRP;
|
516
|
+
static cardano: HRP;
|
517
|
+
static qtum: HRP;
|
518
|
+
static osmosis: HRP;
|
519
|
+
static terraV2: HRP;
|
520
|
+
static nativeEvmos: HRP;
|
553
521
|
}
|
554
522
|
|
555
|
-
declare function
|
523
|
+
declare function describeHRP(value: HRP): string;
|
556
524
|
|
557
525
|
export class Hash {
|
558
526
|
static sha1(data: Uint8Array | Buffer): Uint8Array;
|
@@ -574,12 +542,14 @@ export class Hash {
|
|
574
542
|
static blake256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
575
543
|
static groestl512Groestl512(data: Uint8Array | Buffer): Uint8Array;
|
576
544
|
}
|
577
|
-
export class
|
578
|
-
static
|
579
|
-
static
|
580
|
-
|
581
|
-
|
582
|
-
|
545
|
+
export class Mnemonic {
|
546
|
+
static isValid(mnemonic: string): boolean;
|
547
|
+
static isValidWord(word: string): boolean;
|
548
|
+
static suggest(prefix: string): string;
|
549
|
+
}
|
550
|
+
export class NEARAccount {
|
551
|
+
static createWithString(string: string): NEARAccount;
|
552
|
+
description(): string;
|
583
553
|
delete(): void;
|
584
554
|
}
|
585
555
|
export class NervosAddress {
|
@@ -592,201 +562,231 @@ export class NervosAddress {
|
|
592
562
|
args(): Uint8Array;
|
593
563
|
delete(): void;
|
594
564
|
}
|
595
|
-
export class
|
565
|
+
export class PBKDF2 {
|
566
|
+
static hmacSha256(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
567
|
+
static hmacSha512(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
568
|
+
}
|
569
|
+
export class PrivateKey {
|
570
|
+
static isValid(data: Uint8Array | Buffer, curve: Curve): boolean;
|
571
|
+
static create(): PrivateKey;
|
572
|
+
static createWithData(data: Uint8Array | Buffer): PrivateKey;
|
573
|
+
static createCopy(key: PrivateKey): PrivateKey;
|
574
|
+
data(): Uint8Array;
|
575
|
+
getPublicKey(coinType: CoinType): PublicKey;
|
576
|
+
getPublicKeyByType(pubkeyType: PublicKeyType): PublicKey;
|
577
|
+
getPublicKeySecp256k1(compressed: boolean): PublicKey;
|
578
|
+
getPublicKeyNist256p1(): PublicKey;
|
579
|
+
getPublicKeyEd25519(): PublicKey;
|
580
|
+
getPublicKeyEd25519Blake2b(): PublicKey;
|
581
|
+
getPublicKeyEd25519Cardano(): PublicKey;
|
582
|
+
getPublicKeyCurve25519(): PublicKey;
|
583
|
+
getSharedKey(publicKey: PublicKey, curve: Curve): Uint8Array;
|
584
|
+
sign(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
585
|
+
signAsDER(digest: Uint8Array | Buffer): Uint8Array;
|
586
|
+
signZilliqaSchnorr(message: Uint8Array | Buffer): Uint8Array;
|
587
|
+
delete(): void;
|
588
|
+
}
|
589
|
+
export class PrivateKeyType {
|
596
590
|
value: number;
|
597
|
-
static
|
598
|
-
static
|
599
|
-
static poa: EthereumChainID;
|
600
|
-
static vechain: EthereumChainID;
|
601
|
-
static callisto: EthereumChainID;
|
602
|
-
static tomochain: EthereumChainID;
|
603
|
-
static polygon: EthereumChainID;
|
604
|
-
static okc: EthereumChainID;
|
605
|
-
static thundertoken: EthereumChainID;
|
606
|
-
static gochain: EthereumChainID;
|
607
|
-
static meter: EthereumChainID;
|
608
|
-
static celo: EthereumChainID;
|
609
|
-
static wanchain: EthereumChainID;
|
610
|
-
static cronos: EthereumChainID;
|
611
|
-
static optimism: EthereumChainID;
|
612
|
-
static xdai: EthereumChainID;
|
613
|
-
static smartbch: EthereumChainID;
|
614
|
-
static fantom: EthereumChainID;
|
615
|
-
static zksync: EthereumChainID;
|
616
|
-
static boba: EthereumChainID;
|
617
|
-
static kcc: EthereumChainID;
|
618
|
-
static heco: EthereumChainID;
|
619
|
-
static metis: EthereumChainID;
|
620
|
-
static moonbeam: EthereumChainID;
|
621
|
-
static moonriver: EthereumChainID;
|
622
|
-
static ronin: EthereumChainID;
|
623
|
-
static kavaevm: EthereumChainID;
|
624
|
-
static klaytn: EthereumChainID;
|
625
|
-
static avalanchec: EthereumChainID;
|
626
|
-
static evmos: EthereumChainID;
|
627
|
-
static arbitrum: EthereumChainID;
|
628
|
-
static smartchain: EthereumChainID;
|
629
|
-
static aurora: EthereumChainID;
|
591
|
+
static default: PrivateKeyType;
|
592
|
+
static cardano: PrivateKeyType;
|
630
593
|
}
|
631
|
-
export class
|
594
|
+
export class PublicKey {
|
595
|
+
static isValid(data: Uint8Array | Buffer, type: PublicKeyType): boolean;
|
596
|
+
static recover(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): PublicKey;
|
597
|
+
static createWithData(data: Uint8Array | Buffer, type: PublicKeyType): PublicKey;
|
598
|
+
isCompressed(): boolean;
|
599
|
+
compressed(): PublicKey;
|
600
|
+
uncompressed(): PublicKey;
|
601
|
+
data(): Uint8Array;
|
602
|
+
keyType(): PublicKeyType;
|
603
|
+
description(): string;
|
604
|
+
verify(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
605
|
+
verifyAsDER(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
606
|
+
verifyZilliqaSchnorr(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
607
|
+
delete(): void;
|
608
|
+
}
|
609
|
+
export class PublicKeyType {
|
632
610
|
value: number;
|
633
|
-
static
|
634
|
-
static
|
635
|
-
static
|
636
|
-
static
|
637
|
-
static
|
638
|
-
static
|
639
|
-
static
|
640
|
-
static
|
641
|
-
static cosmos: CoinType;
|
642
|
-
static dash: CoinType;
|
643
|
-
static decred: CoinType;
|
644
|
-
static digiByte: CoinType;
|
645
|
-
static dogecoin: CoinType;
|
646
|
-
static eos: CoinType;
|
647
|
-
static ethereum: CoinType;
|
648
|
-
static ethereumClassic: CoinType;
|
649
|
-
static fio: CoinType;
|
650
|
-
static goChain: CoinType;
|
651
|
-
static groestlcoin: CoinType;
|
652
|
-
static icon: CoinType;
|
653
|
-
static ioTeX: CoinType;
|
654
|
-
static kava: CoinType;
|
655
|
-
static kin: CoinType;
|
656
|
-
static litecoin: CoinType;
|
657
|
-
static monacoin: CoinType;
|
658
|
-
static nebulas: CoinType;
|
659
|
-
static nuls: CoinType;
|
660
|
-
static nano: CoinType;
|
661
|
-
static near: CoinType;
|
662
|
-
static nimiq: CoinType;
|
663
|
-
static ontology: CoinType;
|
664
|
-
static poanetwork: CoinType;
|
665
|
-
static qtum: CoinType;
|
666
|
-
static xrp: CoinType;
|
667
|
-
static solana: CoinType;
|
668
|
-
static stellar: CoinType;
|
669
|
-
static tezos: CoinType;
|
670
|
-
static theta: CoinType;
|
671
|
-
static thunderToken: CoinType;
|
672
|
-
static neo: CoinType;
|
673
|
-
static tomoChain: CoinType;
|
674
|
-
static tron: CoinType;
|
675
|
-
static veChain: CoinType;
|
676
|
-
static viacoin: CoinType;
|
677
|
-
static wanchain: CoinType;
|
678
|
-
static zcash: CoinType;
|
679
|
-
static firo: CoinType;
|
680
|
-
static zilliqa: CoinType;
|
681
|
-
static zelcash: CoinType;
|
682
|
-
static ravencoin: CoinType;
|
683
|
-
static waves: CoinType;
|
684
|
-
static terra: CoinType;
|
685
|
-
static terraV2: CoinType;
|
686
|
-
static harmony: CoinType;
|
687
|
-
static algorand: CoinType;
|
688
|
-
static kusama: CoinType;
|
689
|
-
static polkadot: CoinType;
|
690
|
-
static filecoin: CoinType;
|
691
|
-
static elrond: CoinType;
|
692
|
-
static bandChain: CoinType;
|
693
|
-
static smartChainLegacy: CoinType;
|
694
|
-
static smartChain: CoinType;
|
695
|
-
static oasis: CoinType;
|
696
|
-
static polygon: CoinType;
|
697
|
-
static thorchain: CoinType;
|
698
|
-
static bluzelle: CoinType;
|
699
|
-
static optimism: CoinType;
|
700
|
-
static zksync: CoinType;
|
701
|
-
static arbitrum: CoinType;
|
702
|
-
static ecochain: CoinType;
|
703
|
-
static avalancheCChain: CoinType;
|
704
|
-
static xdai: CoinType;
|
705
|
-
static fantom: CoinType;
|
706
|
-
static cryptoOrg: CoinType;
|
707
|
-
static celo: CoinType;
|
708
|
-
static ronin: CoinType;
|
709
|
-
static osmosis: CoinType;
|
710
|
-
static ecash: CoinType;
|
711
|
-
static cronosChain: CoinType;
|
712
|
-
static smartBitcoinCash: CoinType;
|
713
|
-
static kuCoinCommunityChain: CoinType;
|
714
|
-
static boba: CoinType;
|
715
|
-
static metis: CoinType;
|
716
|
-
static aurora: CoinType;
|
717
|
-
static evmos: CoinType;
|
718
|
-
static nativeEvmos: CoinType;
|
719
|
-
static moonriver: CoinType;
|
720
|
-
static moonbeam: CoinType;
|
721
|
-
static kavaEvm: CoinType;
|
722
|
-
static klaytn: CoinType;
|
723
|
-
static meter: CoinType;
|
724
|
-
static okxchain: CoinType;
|
725
|
-
static nervos: CoinType;
|
726
|
-
static everscale: CoinType;
|
727
|
-
static aptos: CoinType;
|
728
|
-
static hedera: CoinType;
|
611
|
+
static secp256k1: PublicKeyType;
|
612
|
+
static secp256k1Extended: PublicKeyType;
|
613
|
+
static nist256p1: PublicKeyType;
|
614
|
+
static nist256p1Extended: PublicKeyType;
|
615
|
+
static ed25519: PublicKeyType;
|
616
|
+
static ed25519Blake2b: PublicKeyType;
|
617
|
+
static curve25519: PublicKeyType;
|
618
|
+
static ed25519Cardano: PublicKeyType;
|
729
619
|
}
|
730
|
-
export class
|
731
|
-
|
732
|
-
static
|
733
|
-
static
|
734
|
-
static
|
620
|
+
export class Purpose {
|
621
|
+
value: number;
|
622
|
+
static bip44: Purpose;
|
623
|
+
static bip49: Purpose;
|
624
|
+
static bip84: Purpose;
|
625
|
+
static bip1852: Purpose;
|
626
|
+
}
|
627
|
+
export class RippleXAddress {
|
628
|
+
static equal(lhs: RippleXAddress, rhs: RippleXAddress): boolean;
|
629
|
+
static isValidString(string: string): boolean;
|
630
|
+
static createWithString(string: string): RippleXAddress;
|
631
|
+
static createWithPublicKey(publicKey: PublicKey, tag: number): RippleXAddress;
|
632
|
+
description(): string;
|
633
|
+
tag(): number;
|
634
|
+
delete(): void;
|
635
|
+
}
|
636
|
+
export class SS58AddressType {
|
637
|
+
value: number;
|
638
|
+
static polkadot: SS58AddressType;
|
639
|
+
static kusama: SS58AddressType;
|
640
|
+
}
|
641
|
+
export class SegwitAddress {
|
642
|
+
static equal(lhs: SegwitAddress, rhs: SegwitAddress): boolean;
|
643
|
+
static isValidString(string: string): boolean;
|
644
|
+
static createWithString(string: string): SegwitAddress;
|
645
|
+
static createWithPublicKey(hrp: HRP, publicKey: PublicKey): SegwitAddress;
|
646
|
+
description(): string;
|
647
|
+
hrp(): HRP;
|
648
|
+
witnessVersion(): number;
|
649
|
+
witnessProgram(): Uint8Array;
|
650
|
+
delete(): void;
|
651
|
+
}
|
652
|
+
export class SolanaAddress {
|
653
|
+
static createWithString(string: string): SolanaAddress;
|
654
|
+
description(): string;
|
655
|
+
defaultTokenAddress(tokenMintAddress: string): string;
|
656
|
+
delete(): void;
|
657
|
+
}
|
658
|
+
export class StellarMemoType {
|
659
|
+
value: number;
|
660
|
+
static none: StellarMemoType;
|
661
|
+
static text: StellarMemoType;
|
662
|
+
static id: StellarMemoType;
|
663
|
+
static hash: StellarMemoType;
|
664
|
+
static return: StellarMemoType;
|
665
|
+
}
|
666
|
+
export class StellarPassphrase {
|
667
|
+
value: number;
|
668
|
+
static stellar: StellarPassphrase;
|
669
|
+
static kin: StellarPassphrase;
|
670
|
+
}
|
671
|
+
|
672
|
+
declare function describeStellarPassphrase(value: StellarPassphrase): string;
|
673
|
+
|
674
|
+
export class StellarVersionByte {
|
675
|
+
value: number;
|
676
|
+
static accountID: StellarVersionByte;
|
677
|
+
static seed: StellarVersionByte;
|
678
|
+
static preAuthTX: StellarVersionByte;
|
679
|
+
static sha256Hash: StellarVersionByte;
|
680
|
+
}
|
681
|
+
export class StoredKey {
|
682
|
+
static load(path: string): StoredKey;
|
683
|
+
static importPrivateKey(privateKey: Uint8Array | Buffer, name: string, password: Uint8Array | Buffer, coin: CoinType): StoredKey;
|
684
|
+
static importPrivateKeyWithEncryption(privateKey: Uint8Array | Buffer, name: string, password: Uint8Array | Buffer, coin: CoinType, encryption: StoredKeyEncryption): StoredKey;
|
685
|
+
static importHDWallet(mnemonic: string, name: string, password: Uint8Array | Buffer, coin: CoinType): StoredKey;
|
686
|
+
static importHDWalletWithEncryption(mnemonic: string, name: string, password: Uint8Array | Buffer, coin: CoinType, encryption: StoredKeyEncryption): StoredKey;
|
687
|
+
static importJSON(json: Uint8Array | Buffer): StoredKey;
|
688
|
+
static createLevel(name: string, password: Uint8Array | Buffer, encryptionLevel: StoredKeyEncryptionLevel): StoredKey;
|
689
|
+
static createLevelAndEncryption(name: string, password: Uint8Array | Buffer, encryptionLevel: StoredKeyEncryptionLevel, encryption: StoredKeyEncryption): StoredKey;
|
690
|
+
static create(name: string, password: Uint8Array | Buffer): StoredKey;
|
691
|
+
static createEncryption(name: string, password: Uint8Array | Buffer, encryption: StoredKeyEncryption): StoredKey;
|
692
|
+
identifier(): string;
|
693
|
+
name(): string;
|
694
|
+
isMnemonic(): boolean;
|
695
|
+
accountCount(): number;
|
696
|
+
encryptionParameters(): string;
|
697
|
+
account(index: number): Account;
|
698
|
+
accountForCoin(coin: CoinType, wallet: HDWallet): Account;
|
699
|
+
accountForCoinDerivation(coin: CoinType, derivation: Derivation, wallet: HDWallet): Account;
|
700
|
+
addAccountDerivation(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
|
701
|
+
addAccount(address: string, coin: CoinType, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
|
702
|
+
removeAccountForCoin(coin: CoinType): void;
|
703
|
+
removeAccountForCoinDerivation(coin: CoinType, derivation: Derivation): void;
|
704
|
+
removeAccountForCoinDerivationPath(coin: CoinType, derivationPath: string): void;
|
705
|
+
store(path: string): boolean;
|
706
|
+
decryptPrivateKey(password: Uint8Array | Buffer): Uint8Array;
|
707
|
+
decryptMnemonic(password: Uint8Array | Buffer): string;
|
708
|
+
privateKey(coin: CoinType, password: Uint8Array | Buffer): PrivateKey;
|
709
|
+
wallet(password: Uint8Array | Buffer): HDWallet;
|
710
|
+
exportJSON(): Uint8Array;
|
711
|
+
fixAddresses(password: Uint8Array | Buffer): boolean;
|
712
|
+
delete(): void;
|
713
|
+
}
|
714
|
+
export class StoredKeyEncryption {
|
715
|
+
value: number;
|
716
|
+
static aes128Ctr: StoredKeyEncryption;
|
717
|
+
static aes128Cbc: StoredKeyEncryption;
|
718
|
+
static aes192Ctr: StoredKeyEncryption;
|
719
|
+
static aes256Ctr: StoredKeyEncryption;
|
720
|
+
}
|
721
|
+
export class StoredKeyEncryptionLevel {
|
722
|
+
value: number;
|
723
|
+
static default: StoredKeyEncryptionLevel;
|
724
|
+
static minimal: StoredKeyEncryptionLevel;
|
725
|
+
static weak: StoredKeyEncryptionLevel;
|
726
|
+
static standard: StoredKeyEncryptionLevel;
|
727
|
+
}
|
728
|
+
export class THORChainSwap {
|
729
|
+
static buildSwap(input: Uint8Array | Buffer): Uint8Array;
|
730
|
+
}
|
731
|
+
export class TransactionCompiler {
|
732
|
+
static buildInput(coinType: CoinType, from: string, to: string, amount: string, asset: string, memo: string, chainId: string): Uint8Array;
|
733
|
+
static preImageHashes(coinType: CoinType, txInputData: Uint8Array | Buffer): Uint8Array;
|
734
|
+
static compileWithSignatures(coinType: CoinType, txInputData: Uint8Array | Buffer, signatures: DataVector, publicKeys: DataVector): Uint8Array;
|
735
735
|
}
|
736
736
|
export interface WalletCore {
|
737
|
-
HexCoding: typeof HexCoding;
|
738
737
|
AnySigner: typeof AnySigner;
|
739
|
-
|
740
|
-
|
741
|
-
StellarVersionByte: typeof StellarVersionByte;
|
742
|
-
PrivateKey: typeof PrivateKey;
|
743
|
-
Derivation: typeof Derivation;
|
744
|
-
StoredKey: typeof StoredKey;
|
745
|
-
EthereumAbiFunction: typeof EthereumAbiFunction;
|
746
|
-
Curve: typeof Curve;
|
747
|
-
CoinTypeConfiguration: typeof CoinTypeConfiguration;
|
748
|
-
StellarMemoType: typeof StellarMemoType;
|
749
|
-
HRP: typeof HRP;
|
750
|
-
PBKDF2: typeof PBKDF2;
|
751
|
-
Blockchain: typeof Blockchain;
|
738
|
+
HexCoding: typeof HexCoding;
|
739
|
+
AES: typeof AES;
|
752
740
|
AESPaddingMode: typeof AESPaddingMode;
|
753
|
-
|
754
|
-
HDWallet: typeof HDWallet;
|
755
|
-
PrivateKeyType: typeof PrivateKeyType;
|
756
|
-
TransactionCompiler: typeof TransactionCompiler;
|
757
|
-
Base64: typeof Base64;
|
758
|
-
StoredKeyEncryptionLevel: typeof StoredKeyEncryptionLevel;
|
759
|
-
SegwitAddress: typeof SegwitAddress;
|
760
|
-
Purpose: typeof Purpose;
|
741
|
+
Account: typeof Account;
|
761
742
|
AnyAddress: typeof AnyAddress;
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
743
|
+
Base32: typeof Base32;
|
744
|
+
Base58: typeof Base58;
|
745
|
+
Base64: typeof Base64;
|
746
|
+
BitcoinAddress: typeof BitcoinAddress;
|
747
|
+
BitcoinMessageSigner: typeof BitcoinMessageSigner;
|
748
|
+
BitcoinScript: typeof BitcoinScript;
|
766
749
|
BitcoinSigHashType: typeof BitcoinSigHashType;
|
750
|
+
Blockchain: typeof Blockchain;
|
767
751
|
Cardano: typeof Cardano;
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
752
|
+
CoinType: typeof CoinType;
|
753
|
+
CoinTypeConfiguration: typeof CoinTypeConfiguration;
|
754
|
+
Curve: typeof Curve;
|
755
|
+
DataVector: typeof DataVector;
|
756
|
+
Derivation: typeof Derivation;
|
757
|
+
DerivationPath: typeof DerivationPath;
|
772
758
|
DerivationPathIndex: typeof DerivationPathIndex;
|
773
|
-
FIOAccount: typeof FIOAccount;
|
774
759
|
EthereumAbi: typeof EthereumAbi;
|
760
|
+
EthereumAbiFunction: typeof EthereumAbiFunction;
|
761
|
+
EthereumAbiValue: typeof EthereumAbiValue;
|
762
|
+
EthereumChainID: typeof EthereumChainID;
|
763
|
+
FIOAccount: typeof FIOAccount;
|
764
|
+
GroestlcoinAddress: typeof GroestlcoinAddress;
|
765
|
+
HDVersion: typeof HDVersion;
|
766
|
+
HDWallet: typeof HDWallet;
|
767
|
+
HRP: typeof HRP;
|
768
|
+
Hash: typeof Hash;
|
775
769
|
Mnemonic: typeof Mnemonic;
|
776
|
-
DerivationPath: typeof DerivationPath;
|
777
|
-
BitcoinMessageSigner: typeof BitcoinMessageSigner;
|
778
770
|
NEARAccount: typeof NEARAccount;
|
779
|
-
|
780
|
-
|
781
|
-
|
771
|
+
NervosAddress: typeof NervosAddress;
|
772
|
+
PBKDF2: typeof PBKDF2;
|
773
|
+
PrivateKey: typeof PrivateKey;
|
774
|
+
PrivateKeyType: typeof PrivateKeyType;
|
775
|
+
PublicKey: typeof PublicKey;
|
776
|
+
PublicKeyType: typeof PublicKeyType;
|
777
|
+
Purpose: typeof Purpose;
|
778
|
+
RippleXAddress: typeof RippleXAddress;
|
782
779
|
SS58AddressType: typeof SS58AddressType;
|
780
|
+
SegwitAddress: typeof SegwitAddress;
|
781
|
+
SolanaAddress: typeof SolanaAddress;
|
782
|
+
StellarMemoType: typeof StellarMemoType;
|
783
783
|
StellarPassphrase: typeof StellarPassphrase;
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
784
|
+
StellarVersionByte: typeof StellarVersionByte;
|
785
|
+
StoredKey: typeof StoredKey;
|
786
|
+
StoredKeyEncryption: typeof StoredKeyEncryption;
|
787
|
+
StoredKeyEncryptionLevel: typeof StoredKeyEncryptionLevel;
|
788
|
+
THORChainSwap: typeof THORChainSwap;
|
789
|
+
TransactionCompiler: typeof TransactionCompiler;
|
790
790
|
describeCurve: typeof describeCurve;
|
791
791
|
describeHRP: typeof describeHRP;
|
792
792
|
describeStellarPassphrase: typeof describeStellarPassphrase;
|