@trustwallet/wallet-core 2.9.4 → 2.9.7

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/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
- import { TW } from "./generated/core_proto";
2
- import * as WalletCore from "./lib/wallet-core";
3
- export { TW, WalletCore };
1
+ export { TW } from "./generated/core_proto";
2
+ export * as WalletCore from "./lib/wallet-core";
package/dist/index.js CHANGED
@@ -1,12 +1,21 @@
1
- "use strict";
2
1
  // Copyright © 2017-2022 Trust Wallet.
3
2
  //
4
3
  // This file is part of Trust. The full Trust copyright notice, including
5
4
  // terms governing use, modification, and redistribution, is contained in the
6
5
  // file LICENSE at the root of the source code distribution tree.
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.WalletCore = exports.TW = void 0;
9
- var core_proto_1 = require("./generated/core_proto");
10
- Object.defineProperty(exports, "TW", { enumerable: true, get: function () { return core_proto_1.TW; } });
11
- var WalletCore = require("./lib/wallet-core");
12
- exports.WalletCore = WalletCore;
6
+ (function (factory) {
7
+ if (typeof module === "object" && typeof module.exports === "object") {
8
+ var v = factory(require, exports);
9
+ if (v !== undefined) module.exports = v;
10
+ }
11
+ else if (typeof define === "function" && define.amd) {
12
+ define(["require", "exports", "./generated/core_proto", "./lib/wallet-core"], factory);
13
+ }
14
+ })(function (require, exports) {
15
+ "use strict";
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.WalletCore = exports.TW = void 0;
18
+ var core_proto_1 = require("./generated/core_proto");
19
+ Object.defineProperty(exports, "TW", { enumerable: true, get: function () { return core_proto_1.TW; } });
20
+ exports.WalletCore = require("./lib/wallet-core");
21
+ });
@@ -0,0 +1,652 @@
1
+ // Copyright © 2017-2022 Trust Wallet.
2
+ //
3
+ // This file is part of Trust. The full Trust copyright notice, including
4
+ // terms governing use, modification, and redistribution, is contained in the
5
+ // file LICENSE at the root of the source code distribution tree.
6
+ //
7
+ // This is a GENERATED FILE, changes made here WILL BE LOST.
8
+ //
9
+ export namespace HexCoding {
10
+ export function decode(hex: string): Uint8Array;
11
+ export function encode(buffer: Uint8Array | Buffer): string;
12
+ }
13
+ export class AnySigner {
14
+ static sign(data: Uint8Array | Buffer, coin: CoinType): Uint8Array;
15
+ static plan(data: Uint8Array | Buffer, coin: CoinType): Uint8Array;
16
+ static supportsJSON(coin: CoinType): boolean;
17
+ }
18
+ export class PublicKey {
19
+ static isValid(data: Uint8Array | Buffer, type: PublicKeyType): boolean;
20
+ static recover(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): PublicKey;
21
+ static createWithData(data: Uint8Array | Buffer, type: PublicKeyType): PublicKey;
22
+ isCompressed(): boolean;
23
+ compressed(): PublicKey;
24
+ uncompressed(): PublicKey;
25
+ data(): Uint8Array;
26
+ keyType(): PublicKeyType;
27
+ description(): string;
28
+ verify(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
29
+ verifyAsDER(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
30
+ verifySchnorr(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
31
+ delete(): void;
32
+ }
33
+ export class BitcoinAddress {
34
+ static equal(lhs: BitcoinAddress, rhs: BitcoinAddress): boolean;
35
+ static isValid(data: Uint8Array | Buffer): boolean;
36
+ static isValidString(string: string): boolean;
37
+ static createWithString(string: string): BitcoinAddress;
38
+ static createWithData(data: Uint8Array | Buffer): BitcoinAddress;
39
+ static createWithPublicKey(publicKey: PublicKey, prefix: number): BitcoinAddress;
40
+ description(): string;
41
+ prefix(): number;
42
+ keyhash(): Uint8Array;
43
+ delete(): void;
44
+ }
45
+ export class StellarPassphrase {
46
+ value: number;
47
+ static stellar: StellarPassphrase;
48
+ static kin: StellarPassphrase;
49
+ }
50
+
51
+ declare function describeStellarPassphrase(value: StellarPassphrase): string;
52
+
53
+ export class SS58AddressType {
54
+ value: number;
55
+ static polkadot: SS58AddressType;
56
+ static kusama: SS58AddressType;
57
+ }
58
+ export class Hash {
59
+ static sha1(data: Uint8Array | Buffer): Uint8Array;
60
+ static sha256(data: Uint8Array | Buffer): Uint8Array;
61
+ static sha512(data: Uint8Array | Buffer): Uint8Array;
62
+ static sha512_256(data: Uint8Array | Buffer): Uint8Array;
63
+ static keccak256(data: Uint8Array | Buffer): Uint8Array;
64
+ static keccak512(data: Uint8Array | Buffer): Uint8Array;
65
+ static sha3_256(data: Uint8Array | Buffer): Uint8Array;
66
+ static sha3_512(data: Uint8Array | Buffer): Uint8Array;
67
+ static ripemd(data: Uint8Array | Buffer): Uint8Array;
68
+ static blake256(data: Uint8Array | Buffer): Uint8Array;
69
+ static blake2b(data: Uint8Array | Buffer, size: number): Uint8Array;
70
+ static groestl512(data: Uint8Array | Buffer): Uint8Array;
71
+ static sha256SHA256(data: Uint8Array | Buffer): Uint8Array;
72
+ static sha256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
73
+ static sha3_256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
74
+ static blake256Blake256(data: Uint8Array | Buffer): Uint8Array;
75
+ static blake256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
76
+ static groestl512Groestl512(data: Uint8Array | Buffer): Uint8Array;
77
+ }
78
+ export class EthereumAbiFunction {
79
+ static createWithString(name: string): EthereumAbiFunction;
80
+ getType(): string;
81
+ addParamUInt8(val: number, isOutput: boolean): number;
82
+ addParamUInt16(val: number, isOutput: boolean): number;
83
+ addParamUInt32(val: number, isOutput: boolean): number;
84
+ addParamUInt64(val: number, isOutput: boolean): number;
85
+ addParamUInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
86
+ addParamUIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
87
+ addParamInt8(val: number, isOutput: boolean): number;
88
+ addParamInt16(val: number, isOutput: boolean): number;
89
+ addParamInt32(val: number, isOutput: boolean): number;
90
+ addParamInt64(val: number, isOutput: boolean): number;
91
+ addParamInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
92
+ addParamIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
93
+ addParamBool(val: boolean, isOutput: boolean): number;
94
+ addParamString(val: string, isOutput: boolean): number;
95
+ addParamAddress(val: Uint8Array | Buffer, isOutput: boolean): number;
96
+ addParamBytes(val: Uint8Array | Buffer, isOutput: boolean): number;
97
+ addParamBytesFix(size: number, val: Uint8Array | Buffer, isOutput: boolean): number;
98
+ addParamArray(isOutput: boolean): number;
99
+ getParamUInt8(idx: number, isOutput: boolean): number;
100
+ getParamUInt64(idx: number, isOutput: boolean): number;
101
+ getParamUInt256(idx: number, isOutput: boolean): Uint8Array;
102
+ getParamBool(idx: number, isOutput: boolean): boolean;
103
+ getParamString(idx: number, isOutput: boolean): string;
104
+ getParamAddress(idx: number, isOutput: boolean): Uint8Array;
105
+ addInArrayParamUInt8(arrayIdx: number, val: number): number;
106
+ addInArrayParamUInt16(arrayIdx: number, val: number): number;
107
+ addInArrayParamUInt32(arrayIdx: number, val: number): number;
108
+ addInArrayParamUInt64(arrayIdx: number, val: number): number;
109
+ addInArrayParamUInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
110
+ addInArrayParamUIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
111
+ addInArrayParamInt8(arrayIdx: number, val: number): number;
112
+ addInArrayParamInt16(arrayIdx: number, val: number): number;
113
+ addInArrayParamInt32(arrayIdx: number, val: number): number;
114
+ addInArrayParamInt64(arrayIdx: number, val: number): number;
115
+ addInArrayParamInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
116
+ addInArrayParamIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
117
+ addInArrayParamBool(arrayIdx: number, val: boolean): number;
118
+ addInArrayParamString(arrayIdx: number, val: string): number;
119
+ addInArrayParamAddress(arrayIdx: number, val: Uint8Array | Buffer): number;
120
+ addInArrayParamBytes(arrayIdx: number, val: Uint8Array | Buffer): number;
121
+ addInArrayParamBytesFix(arrayIdx: number, size: number, val: Uint8Array | Buffer): number;
122
+ delete(): void;
123
+ }
124
+ export class Base32 {
125
+ static decodeWithAlphabet(string: string, alphabet: string): Uint8Array;
126
+ static decode(string: string): Uint8Array;
127
+ static encodeWithAlphabet(data: Uint8Array | Buffer, alphabet: string): string;
128
+ static encode(data: Uint8Array | Buffer): string;
129
+ }
130
+ export class AES {
131
+ static encryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
132
+ static decryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
133
+ static encryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
134
+ static decryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
135
+ }
136
+ export class CoinType {
137
+ value: number;
138
+ static aeternity: CoinType;
139
+ static aion: CoinType;
140
+ static binance: CoinType;
141
+ static bitcoin: CoinType;
142
+ static bitcoinCash: CoinType;
143
+ static bitcoinGold: CoinType;
144
+ static callisto: CoinType;
145
+ static cardano: CoinType;
146
+ static cosmos: CoinType;
147
+ static dash: CoinType;
148
+ static decred: CoinType;
149
+ static digiByte: CoinType;
150
+ static dogecoin: CoinType;
151
+ static eos: CoinType;
152
+ static ethereum: CoinType;
153
+ static ethereumClassic: CoinType;
154
+ static fio: CoinType;
155
+ static goChain: CoinType;
156
+ static groestlcoin: CoinType;
157
+ static icon: CoinType;
158
+ static ioTeX: CoinType;
159
+ static kava: CoinType;
160
+ static kin: CoinType;
161
+ static litecoin: CoinType;
162
+ static monacoin: CoinType;
163
+ static nebulas: CoinType;
164
+ static nuls: CoinType;
165
+ static nano: CoinType;
166
+ static near: CoinType;
167
+ static nimiq: CoinType;
168
+ static ontology: CoinType;
169
+ static poanetwork: CoinType;
170
+ static qtum: CoinType;
171
+ static xrp: CoinType;
172
+ static solana: CoinType;
173
+ static stellar: CoinType;
174
+ static tezos: CoinType;
175
+ static theta: CoinType;
176
+ static thunderToken: CoinType;
177
+ static neo: CoinType;
178
+ static tomoChain: CoinType;
179
+ static tron: CoinType;
180
+ static veChain: CoinType;
181
+ static viacoin: CoinType;
182
+ static wanchain: CoinType;
183
+ static zcash: CoinType;
184
+ static firo: CoinType;
185
+ static zilliqa: CoinType;
186
+ static zelcash: CoinType;
187
+ static ravencoin: CoinType;
188
+ static waves: CoinType;
189
+ static terra: CoinType;
190
+ static terraV2: CoinType;
191
+ static harmony: CoinType;
192
+ static algorand: CoinType;
193
+ static kusama: CoinType;
194
+ static polkadot: CoinType;
195
+ static filecoin: CoinType;
196
+ static elrond: CoinType;
197
+ static bandChain: CoinType;
198
+ static smartChainLegacy: CoinType;
199
+ static smartChain: CoinType;
200
+ static oasis: CoinType;
201
+ static polygon: CoinType;
202
+ static thorchain: CoinType;
203
+ static bluzelle: CoinType;
204
+ static optimism: CoinType;
205
+ static arbitrum: CoinType;
206
+ static ecochain: CoinType;
207
+ static avalancheCChain: CoinType;
208
+ static xdai: CoinType;
209
+ static fantom: CoinType;
210
+ static cryptoOrg: CoinType;
211
+ static celo: CoinType;
212
+ static ronin: CoinType;
213
+ static osmosis: CoinType;
214
+ static ecash: CoinType;
215
+ static cronosChain: CoinType;
216
+ static smartBitcoinCash: CoinType;
217
+ static kuCoinCommunityChain: CoinType;
218
+ static boba: CoinType;
219
+ static metis: CoinType;
220
+ static aurora: CoinType;
221
+ static evmos: CoinType;
222
+ static nativeEvmos: CoinType;
223
+ static moonriver: CoinType;
224
+ static moonbeam: CoinType;
225
+ static kavaEvm: CoinType;
226
+ static klaytn: CoinType;
227
+ static meter: CoinType;
228
+ }
229
+ export class StellarMemoType {
230
+ value: number;
231
+ static none: StellarMemoType;
232
+ static text: StellarMemoType;
233
+ static id: StellarMemoType;
234
+ static hash: StellarMemoType;
235
+ static return: StellarMemoType;
236
+ }
237
+ export class THORChainSwap {
238
+ static buildSwap(input: Uint8Array | Buffer): Uint8Array;
239
+ }
240
+ export class PBKDF2 {
241
+ static hmacSha256(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
242
+ static hmacSha512(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
243
+ }
244
+ export class HDWallet {
245
+ static getPublicKeyFromExtended(extended: string, coin: CoinType, derivationPath: string): PublicKey;
246
+ static create(strength: number, passphrase: string): HDWallet;
247
+ static createWithMnemonic(mnemonic: string, passphrase: string): HDWallet;
248
+ static createWithMnemonicCheck(mnemonic: string, passphrase: string, check: boolean): HDWallet;
249
+ static createWithEntropy(entropy: Uint8Array | Buffer, passphrase: string): HDWallet;
250
+ seed(): Uint8Array;
251
+ mnemonic(): string;
252
+ entropy(): Uint8Array;
253
+ getMasterKey(curve: Curve): PrivateKey;
254
+ getKeyForCoin(coin: CoinType): PrivateKey;
255
+ getAddressForCoin(coin: CoinType): string;
256
+ getKey(coin: CoinType, derivationPath: string): PrivateKey;
257
+ getDerivedKey(coin: CoinType, account: number, change: number, address: number): PrivateKey;
258
+ getExtendedPrivateKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
259
+ getExtendedPublicKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
260
+ getExtendedPrivateKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
261
+ getExtendedPublicKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
262
+ getExtendedPrivateKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
263
+ getExtendedPublicKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
264
+ delete(): void;
265
+ }
266
+ export class RippleXAddress {
267
+ static equal(lhs: RippleXAddress, rhs: RippleXAddress): boolean;
268
+ static isValidString(string: string): boolean;
269
+ static createWithString(string: string): RippleXAddress;
270
+ static createWithPublicKey(publicKey: PublicKey, tag: number): RippleXAddress;
271
+ description(): string;
272
+ tag(): number;
273
+ delete(): void;
274
+ }
275
+ export class HRP {
276
+ value: number;
277
+ static unknown: HRP;
278
+ static bitcoin: HRP;
279
+ static litecoin: HRP;
280
+ static viacoin: HRP;
281
+ static groestlcoin: HRP;
282
+ static digiByte: HRP;
283
+ static monacoin: HRP;
284
+ static cosmos: HRP;
285
+ static bitcoinCash: HRP;
286
+ static bitcoinGold: HRP;
287
+ static ioTeX: HRP;
288
+ static zilliqa: HRP;
289
+ static terra: HRP;
290
+ static cryptoOrg: HRP;
291
+ static kava: HRP;
292
+ static oasis: HRP;
293
+ static bluzelle: HRP;
294
+ static bandChain: HRP;
295
+ static elrond: HRP;
296
+ static binance: HRP;
297
+ static ecash: HRP;
298
+ static thorchain: HRP;
299
+ static harmony: HRP;
300
+ static cardano: HRP;
301
+ static qtum: HRP;
302
+ static osmosis: HRP;
303
+ static terraV2: HRP;
304
+ static nativeEvmos: HRP;
305
+ }
306
+
307
+ declare function describeHRP(value: HRP): string;
308
+
309
+ export class EthereumAbiValue {
310
+ static encodeBool(value: boolean): Uint8Array;
311
+ static encodeInt32(value: number): Uint8Array;
312
+ static encodeUInt32(value: number): Uint8Array;
313
+ static encodeInt256(value: Uint8Array | Buffer): Uint8Array;
314
+ static encodeUInt256(value: Uint8Array | Buffer): Uint8Array;
315
+ static encodeAddress(value: Uint8Array | Buffer): Uint8Array;
316
+ static encodeString(value: string): Uint8Array;
317
+ static encodeBytes(value: Uint8Array | Buffer): Uint8Array;
318
+ static encodeBytesDyn(value: Uint8Array | Buffer): Uint8Array;
319
+ static decodeUInt256(input: Uint8Array | Buffer): string;
320
+ static decodeValue(input: Uint8Array | Buffer, type: string): string;
321
+ static decodeArray(input: Uint8Array | Buffer, type: string): string;
322
+ }
323
+ export class TransactionCompiler {
324
+ static buildInput(coinType: CoinType, from: string, to: string, amount: string, asset: string, memo: string, chainId: string): Uint8Array;
325
+ static preImageHashes(coinType: CoinType, txInputData: Uint8Array | Buffer): Uint8Array;
326
+ static compileWithSignatures(coinType: CoinType, txInputData: Uint8Array | Buffer, signatures: DataVector, publicKeys: DataVector): Uint8Array;
327
+ }
328
+ export class StoredKeyEncryptionLevel {
329
+ value: number;
330
+ static default: StoredKeyEncryptionLevel;
331
+ static minimal: StoredKeyEncryptionLevel;
332
+ static weak: StoredKeyEncryptionLevel;
333
+ static standard: StoredKeyEncryptionLevel;
334
+ }
335
+ export class NEARAccount {
336
+ static createWithString(string: string): NEARAccount;
337
+ description(): string;
338
+ delete(): void;
339
+ }
340
+ export class StellarVersionByte {
341
+ value: number;
342
+ static accountID: StellarVersionByte;
343
+ static seed: StellarVersionByte;
344
+ static preAuthTX: StellarVersionByte;
345
+ static sha256Hash: StellarVersionByte;
346
+ }
347
+ export class Derivation {
348
+ value: number;
349
+ static default: Derivation;
350
+ static custom: Derivation;
351
+ static bitcoinSegwit: Derivation;
352
+ static bitcoinLegacy: Derivation;
353
+ static litecoinLegacy: Derivation;
354
+ static solanaSolana: Derivation;
355
+ }
356
+ export class PublicKeyType {
357
+ value: number;
358
+ static secp256k1: PublicKeyType;
359
+ static secp256k1Extended: PublicKeyType;
360
+ static nist256p1: PublicKeyType;
361
+ static nist256p1Extended: PublicKeyType;
362
+ static ed25519: PublicKeyType;
363
+ static ed25519Blake2b: PublicKeyType;
364
+ static curve25519: PublicKeyType;
365
+ static ed25519Extended: PublicKeyType;
366
+ }
367
+ export class Account {
368
+ static create(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): Account;
369
+ address(): string;
370
+ derivation(): Derivation;
371
+ derivationPath(): string;
372
+ publicKey(): string;
373
+ extendedPublicKey(): string;
374
+ coin(): CoinType;
375
+ delete(): void;
376
+ }
377
+ export class Base58 {
378
+ static encode(data: Uint8Array | Buffer): string;
379
+ static encodeNoCheck(data: Uint8Array | Buffer): string;
380
+ static decode(string: string): Uint8Array;
381
+ static decodeNoCheck(string: string): Uint8Array;
382
+ }
383
+ export class FIOAccount {
384
+ static createWithString(string: string): FIOAccount;
385
+ description(): string;
386
+ delete(): void;
387
+ }
388
+ export class SegwitAddress {
389
+ static equal(lhs: SegwitAddress, rhs: SegwitAddress): boolean;
390
+ static isValidString(string: string): boolean;
391
+ static createWithString(string: string): SegwitAddress;
392
+ static createWithPublicKey(hrp: HRP, publicKey: PublicKey): SegwitAddress;
393
+ description(): string;
394
+ hrp(): HRP;
395
+ witnessVersion(): number;
396
+ witnessProgram(): Uint8Array;
397
+ delete(): void;
398
+ }
399
+ export class Mnemonic {
400
+ static isValid(mnemonic: string): boolean;
401
+ static isValidWord(word: string): boolean;
402
+ static suggest(prefix: string): string;
403
+ }
404
+ export class EthereumAbi {
405
+ static encode(fn: EthereumAbiFunction): Uint8Array;
406
+ static decodeOutput(fn: EthereumAbiFunction, encoded: Uint8Array | Buffer): boolean;
407
+ static decodeCall(data: Uint8Array | Buffer, abi: string): string;
408
+ static encodeTyped(messageJson: string): Uint8Array;
409
+ }
410
+ export class CoinTypeConfiguration {
411
+ static getSymbol(type: CoinType): string;
412
+ static getDecimals(type: CoinType): number;
413
+ static getTransactionURL(type: CoinType, transactionID: string): string;
414
+ static getAccountURL(type: CoinType, accountID: string): string;
415
+ static getID(type: CoinType): string;
416
+ static getName(type: CoinType): string;
417
+ }
418
+ export class StoredKey {
419
+ static load(path: string): StoredKey;
420
+ static importPrivateKey(privateKey: Uint8Array | Buffer, name: string, password: Uint8Array | Buffer, coin: CoinType): StoredKey;
421
+ static importHDWallet(mnemonic: string, name: string, password: Uint8Array | Buffer, coin: CoinType): StoredKey;
422
+ static importJSON(json: Uint8Array | Buffer): StoredKey;
423
+ static createLevel(name: string, password: Uint8Array | Buffer, encryptionLevel: StoredKeyEncryptionLevel): StoredKey;
424
+ static create(name: string, password: Uint8Array | Buffer): StoredKey;
425
+ identifier(): string;
426
+ name(): string;
427
+ isMnemonic(): boolean;
428
+ accountCount(): number;
429
+ encryptionParameters(): string;
430
+ account(index: number): Account;
431
+ accountForCoin(coin: CoinType, wallet: HDWallet): Account;
432
+ accountForCoinDerivation(coin: CoinType, derivation: Derivation, wallet: HDWallet): Account;
433
+ addAccountDerivation(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
434
+ addAccount(address: string, coin: CoinType, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
435
+ removeAccountForCoin(coin: CoinType): void;
436
+ removeAccountForCoinDerivation(coin: CoinType, derivation: Derivation): void;
437
+ removeAccountForCoinDerivationPath(coin: CoinType, derivationPath: string): void;
438
+ store(path: string): boolean;
439
+ decryptPrivateKey(password: Uint8Array | Buffer): Uint8Array;
440
+ decryptMnemonic(password: Uint8Array | Buffer): string;
441
+ privateKey(coin: CoinType, password: Uint8Array | Buffer): PrivateKey;
442
+ wallet(password: Uint8Array | Buffer): HDWallet;
443
+ exportJSON(): Uint8Array;
444
+ fixAddresses(password: Uint8Array | Buffer): boolean;
445
+ delete(): void;
446
+ }
447
+ export class BitcoinSigHashType {
448
+ value: number;
449
+ static all: BitcoinSigHashType;
450
+ static none: BitcoinSigHashType;
451
+ static single: BitcoinSigHashType;
452
+ static fork: BitcoinSigHashType;
453
+ static forkBTG: BitcoinSigHashType;
454
+ }
455
+ export class EthereumChainID {
456
+ value: number;
457
+ static ethereum: EthereumChainID;
458
+ static classic: EthereumChainID;
459
+ static poa: EthereumChainID;
460
+ static vechain: EthereumChainID;
461
+ static callisto: EthereumChainID;
462
+ static tomochain: EthereumChainID;
463
+ static polygon: EthereumChainID;
464
+ static thundertoken: EthereumChainID;
465
+ static gochain: EthereumChainID;
466
+ static meter: EthereumChainID;
467
+ static celo: EthereumChainID;
468
+ static wanchain: EthereumChainID;
469
+ static cronos: EthereumChainID;
470
+ static optimism: EthereumChainID;
471
+ static xdai: EthereumChainID;
472
+ static smartbch: EthereumChainID;
473
+ static fantom: EthereumChainID;
474
+ static boba: EthereumChainID;
475
+ static kcc: EthereumChainID;
476
+ static heco: EthereumChainID;
477
+ static metis: EthereumChainID;
478
+ static moonbeam: EthereumChainID;
479
+ static moonriver: EthereumChainID;
480
+ static ronin: EthereumChainID;
481
+ static kavaevm: EthereumChainID;
482
+ static klaytn: EthereumChainID;
483
+ static avalanchec: EthereumChainID;
484
+ static evmos: EthereumChainID;
485
+ static arbitrum: EthereumChainID;
486
+ static smartchain: EthereumChainID;
487
+ static aurora: EthereumChainID;
488
+ }
489
+ export class DataVector {
490
+ static create(): DataVector;
491
+ static createWithData(data: Uint8Array | Buffer): DataVector;
492
+ size(): number;
493
+ add(data: Uint8Array | Buffer): void;
494
+ get(index: number): Uint8Array;
495
+ delete(): void;
496
+ }
497
+ export class SolanaAddress {
498
+ static createWithString(string: string): SolanaAddress;
499
+ description(): string;
500
+ defaultTokenAddress(tokenMintAddress: string): string;
501
+ delete(): void;
502
+ }
503
+ export class GroestlcoinAddress {
504
+ static equal(lhs: GroestlcoinAddress, rhs: GroestlcoinAddress): boolean;
505
+ static isValidString(string: string): boolean;
506
+ static createWithString(string: string): GroestlcoinAddress;
507
+ static createWithPublicKey(publicKey: PublicKey, prefix: number): GroestlcoinAddress;
508
+ description(): string;
509
+ delete(): void;
510
+ }
511
+ export class Blockchain {
512
+ value: number;
513
+ static bitcoin: Blockchain;
514
+ static ethereum: Blockchain;
515
+ static vechain: Blockchain;
516
+ static tron: Blockchain;
517
+ static icon: Blockchain;
518
+ static binance: Blockchain;
519
+ static ripple: Blockchain;
520
+ static tezos: Blockchain;
521
+ static nimiq: Blockchain;
522
+ static stellar: Blockchain;
523
+ static aion: Blockchain;
524
+ static cosmos: Blockchain;
525
+ static theta: Blockchain;
526
+ static ontology: Blockchain;
527
+ static zilliqa: Blockchain;
528
+ static ioTeX: Blockchain;
529
+ static eos: Blockchain;
530
+ static nano: Blockchain;
531
+ static nuls: Blockchain;
532
+ static waves: Blockchain;
533
+ static aeternity: Blockchain;
534
+ static nebulas: Blockchain;
535
+ static fio: Blockchain;
536
+ static solana: Blockchain;
537
+ static harmony: Blockchain;
538
+ static near: Blockchain;
539
+ static algorand: Blockchain;
540
+ static polkadot: Blockchain;
541
+ static cardano: Blockchain;
542
+ static neo: Blockchain;
543
+ static filecoin: Blockchain;
544
+ static elrondNetwork: Blockchain;
545
+ static oasisNetwork: Blockchain;
546
+ static decred: Blockchain;
547
+ static zcash: Blockchain;
548
+ static groestlcoin: Blockchain;
549
+ static thorchain: Blockchain;
550
+ static ronin: Blockchain;
551
+ static kusama: Blockchain;
552
+ }
553
+ export class Cardano {
554
+ static minAdaAmount(tokenBundle: Uint8Array | Buffer): number;
555
+ }
556
+ export class PrivateKey {
557
+ static isValid(data: Uint8Array | Buffer, curve: Curve): boolean;
558
+ static create(): PrivateKey;
559
+ static createWithData(data: Uint8Array | Buffer): PrivateKey;
560
+ static createCopy(key: PrivateKey): PrivateKey;
561
+ data(): Uint8Array;
562
+ getPublicKeySecp256k1(compressed: boolean): PublicKey;
563
+ getPublicKeyNist256p1(): PublicKey;
564
+ getPublicKeyEd25519(): PublicKey;
565
+ getPublicKeyEd25519Blake2b(): PublicKey;
566
+ getPublicKeyEd25519Extended(): PublicKey;
567
+ getPublicKeyCurve25519(): PublicKey;
568
+ getSharedKey(publicKey: PublicKey, curve: Curve): Uint8Array;
569
+ sign(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
570
+ signAsDER(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
571
+ signSchnorr(message: Uint8Array | Buffer, curve: Curve): Uint8Array;
572
+ delete(): void;
573
+ }
574
+ export class HDVersion {
575
+ value: number;
576
+ static none: HDVersion;
577
+ static xpub: HDVersion;
578
+ static xprv: HDVersion;
579
+ static ypub: HDVersion;
580
+ static yprv: HDVersion;
581
+ static zpub: HDVersion;
582
+ static zprv: HDVersion;
583
+ static ltub: HDVersion;
584
+ static ltpv: HDVersion;
585
+ static mtub: HDVersion;
586
+ static mtpv: HDVersion;
587
+ static dpub: HDVersion;
588
+ static dprv: HDVersion;
589
+ static dgub: HDVersion;
590
+ static dgpv: HDVersion;
591
+ }
592
+ export class BitcoinScript {
593
+ static equal(lhs: BitcoinScript, rhs: BitcoinScript): boolean;
594
+ static buildPayToPublicKey(pubkey: Uint8Array | Buffer): BitcoinScript;
595
+ static buildPayToPublicKeyHash(hash: Uint8Array | Buffer): BitcoinScript;
596
+ static buildPayToScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
597
+ static buildPayToWitnessPubkeyHash(hash: Uint8Array | Buffer): BitcoinScript;
598
+ static buildPayToWitnessScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
599
+ static lockScriptForAddress(address: string, coin: CoinType): BitcoinScript;
600
+ static hashTypeForCoin(coinType: CoinType): number;
601
+ static create(): BitcoinScript;
602
+ static createWithData(data: Uint8Array | Buffer): BitcoinScript;
603
+ static createCopy(script: BitcoinScript): BitcoinScript;
604
+ size(): number;
605
+ data(): Uint8Array;
606
+ scriptHash(): Uint8Array;
607
+ isPayToScriptHash(): boolean;
608
+ isPayToWitnessScriptHash(): boolean;
609
+ isPayToWitnessPublicKeyHash(): boolean;
610
+ isWitnessProgram(): boolean;
611
+ matchPayToPubkey(): Uint8Array;
612
+ matchPayToPubkeyHash(): Uint8Array;
613
+ matchPayToScriptHash(): Uint8Array;
614
+ matchPayToWitnessPublicKeyHash(): Uint8Array;
615
+ matchPayToWitnessScriptHash(): Uint8Array;
616
+ encode(): Uint8Array;
617
+ delete(): void;
618
+ }
619
+ export class Purpose {
620
+ value: number;
621
+ static bip44: Purpose;
622
+ static bip49: Purpose;
623
+ static bip84: Purpose;
624
+ static bip1852: Purpose;
625
+ }
626
+ export class AnyAddress {
627
+ static equal(lhs: AnyAddress, rhs: AnyAddress): boolean;
628
+ static isValid(string: string, coin: CoinType): boolean;
629
+ static createWithString(string: string, coin: CoinType): AnyAddress;
630
+ static createWithPublicKey(publicKey: PublicKey, coin: CoinType): AnyAddress;
631
+ description(): string;
632
+ coin(): CoinType;
633
+ data(): Uint8Array;
634
+ delete(): void;
635
+ }
636
+ export class AESPaddingMode {
637
+ value: number;
638
+ static zero: AESPaddingMode;
639
+ static pkcs7: AESPaddingMode;
640
+ }
641
+ export class Curve {
642
+ value: number;
643
+ static secp256k1: Curve;
644
+ static ed25519: Curve;
645
+ static ed25519Blake2bNano: Curve;
646
+ static curve25519: Curve;
647
+ static nist256p1: Curve;
648
+ static ed25519Extended: Curve;
649
+ }
650
+
651
+ declare function describeCurve(value: Curve): string;
652
+