@trustwallet/wallet-core 3.1.4 → 3.1.6
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 +609 -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,280 @@ 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;
|
273
|
+
static secret: CoinType;
|
313
274
|
}
|
314
|
-
export class
|
315
|
-
static
|
316
|
-
static
|
317
|
-
static
|
318
|
-
static
|
275
|
+
export class CoinTypeConfiguration {
|
276
|
+
static getSymbol(type: CoinType): string;
|
277
|
+
static getDecimals(type: CoinType): number;
|
278
|
+
static getTransactionURL(type: CoinType, transactionID: string): string;
|
279
|
+
static getAccountURL(type: CoinType, accountID: string): string;
|
280
|
+
static getID(type: CoinType): string;
|
281
|
+
static getName(type: CoinType): string;
|
319
282
|
}
|
320
|
-
export class
|
283
|
+
export class Curve {
|
321
284
|
value: number;
|
322
|
-
static
|
323
|
-
static
|
324
|
-
static
|
325
|
-
static
|
285
|
+
static secp256k1: Curve;
|
286
|
+
static ed25519: Curve;
|
287
|
+
static ed25519Blake2bNano: Curve;
|
288
|
+
static curve25519: Curve;
|
289
|
+
static nist256p1: Curve;
|
290
|
+
static ed25519ExtendedCardano: Curve;
|
326
291
|
}
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
static
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
292
|
+
|
293
|
+
declare function describeCurve(value: Curve): string;
|
294
|
+
|
295
|
+
export class DataVector {
|
296
|
+
static create(): DataVector;
|
297
|
+
static createWithData(data: Uint8Array | Buffer): DataVector;
|
298
|
+
size(): number;
|
299
|
+
add(data: Uint8Array | Buffer): void;
|
300
|
+
get(index: number): Uint8Array;
|
336
301
|
delete(): void;
|
337
302
|
}
|
338
|
-
export class
|
303
|
+
export class Derivation {
|
339
304
|
value: number;
|
340
|
-
static
|
341
|
-
static
|
342
|
-
static
|
343
|
-
static
|
305
|
+
static default: Derivation;
|
306
|
+
static custom: Derivation;
|
307
|
+
static bitcoinSegwit: Derivation;
|
308
|
+
static bitcoinLegacy: Derivation;
|
309
|
+
static bitcoinTestnet: Derivation;
|
310
|
+
static litecoinLegacy: Derivation;
|
311
|
+
static solanaSolana: Derivation;
|
344
312
|
}
|
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;
|
313
|
+
export class DerivationPath {
|
314
|
+
static create(purpose: Purpose, coin: number, account: number, change: number, address: number): DerivationPath;
|
315
|
+
static createWithString(string: string): DerivationPath;
|
316
|
+
purpose(): Purpose;
|
317
|
+
coin(): number;
|
318
|
+
account(): number;
|
319
|
+
change(): number;
|
320
|
+
address(): number;
|
357
321
|
description(): string;
|
358
|
-
|
359
|
-
|
322
|
+
indexAt(index: number): DerivationPathIndex;
|
323
|
+
indicesCount(): number;
|
360
324
|
delete(): void;
|
361
325
|
}
|
362
|
-
export class
|
363
|
-
static
|
364
|
-
|
365
|
-
|
366
|
-
static createWithPublicKey(publicKey: PublicKey, prefix: number): GroestlcoinAddress;
|
326
|
+
export class DerivationPathIndex {
|
327
|
+
static create(value: number, hardened: boolean): DerivationPathIndex;
|
328
|
+
value(): number;
|
329
|
+
hardened(): boolean;
|
367
330
|
description(): string;
|
368
331
|
delete(): void;
|
369
332
|
}
|
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;
|
333
|
+
export class EthereumAbi {
|
334
|
+
static encode(fn: EthereumAbiFunction): Uint8Array;
|
335
|
+
static decodeOutput(fn: EthereumAbiFunction, encoded: Uint8Array | Buffer): boolean;
|
336
|
+
static decodeCall(data: Uint8Array | Buffer, abi: string): string;
|
337
|
+
static encodeTyped(messageJson: string): Uint8Array;
|
411
338
|
}
|
412
|
-
export class
|
413
|
-
static
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
339
|
+
export class EthereumAbiFunction {
|
340
|
+
static createWithString(name: string): EthereumAbiFunction;
|
341
|
+
getType(): string;
|
342
|
+
addParamUInt8(val: number, isOutput: boolean): number;
|
343
|
+
addParamUInt16(val: number, isOutput: boolean): number;
|
344
|
+
addParamUInt32(val: number, isOutput: boolean): number;
|
345
|
+
addParamUInt64(val: number, isOutput: boolean): number;
|
346
|
+
addParamUInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
|
347
|
+
addParamUIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
348
|
+
addParamInt8(val: number, isOutput: boolean): number;
|
349
|
+
addParamInt16(val: number, isOutput: boolean): number;
|
350
|
+
addParamInt32(val: number, isOutput: boolean): number;
|
351
|
+
addParamInt64(val: number, isOutput: boolean): number;
|
352
|
+
addParamInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
|
353
|
+
addParamIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
354
|
+
addParamBool(val: boolean, isOutput: boolean): number;
|
355
|
+
addParamString(val: string, isOutput: boolean): number;
|
356
|
+
addParamAddress(val: Uint8Array | Buffer, isOutput: boolean): number;
|
357
|
+
addParamBytes(val: Uint8Array | Buffer, isOutput: boolean): number;
|
358
|
+
addParamBytesFix(size: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
359
|
+
addParamArray(isOutput: boolean): number;
|
360
|
+
getParamUInt8(idx: number, isOutput: boolean): number;
|
361
|
+
getParamUInt64(idx: number, isOutput: boolean): number;
|
362
|
+
getParamUInt256(idx: number, isOutput: boolean): Uint8Array;
|
363
|
+
getParamBool(idx: number, isOutput: boolean): boolean;
|
364
|
+
getParamString(idx: number, isOutput: boolean): string;
|
365
|
+
getParamAddress(idx: number, isOutput: boolean): Uint8Array;
|
366
|
+
addInArrayParamUInt8(arrayIdx: number, val: number): number;
|
367
|
+
addInArrayParamUInt16(arrayIdx: number, val: number): number;
|
368
|
+
addInArrayParamUInt32(arrayIdx: number, val: number): number;
|
369
|
+
addInArrayParamUInt64(arrayIdx: number, val: number): number;
|
370
|
+
addInArrayParamUInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
371
|
+
addInArrayParamUIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
372
|
+
addInArrayParamInt8(arrayIdx: number, val: number): number;
|
373
|
+
addInArrayParamInt16(arrayIdx: number, val: number): number;
|
374
|
+
addInArrayParamInt32(arrayIdx: number, val: number): number;
|
375
|
+
addInArrayParamInt64(arrayIdx: number, val: number): number;
|
376
|
+
addInArrayParamInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
377
|
+
addInArrayParamIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
378
|
+
addInArrayParamBool(arrayIdx: number, val: boolean): number;
|
379
|
+
addInArrayParamString(arrayIdx: number, val: string): number;
|
380
|
+
addInArrayParamAddress(arrayIdx: number, val: Uint8Array | Buffer): number;
|
381
|
+
addInArrayParamBytes(arrayIdx: number, val: Uint8Array | Buffer): number;
|
382
|
+
addInArrayParamBytesFix(arrayIdx: number, size: number, val: Uint8Array | Buffer): number;
|
422
383
|
delete(): void;
|
423
384
|
}
|
424
|
-
export class
|
425
|
-
value:
|
426
|
-
static
|
427
|
-
static
|
428
|
-
static
|
429
|
-
static
|
430
|
-
static
|
431
|
-
static
|
432
|
-
static
|
433
|
-
static
|
385
|
+
export class EthereumAbiValue {
|
386
|
+
static encodeBool(value: boolean): Uint8Array;
|
387
|
+
static encodeInt32(value: number): Uint8Array;
|
388
|
+
static encodeUInt32(value: number): Uint8Array;
|
389
|
+
static encodeInt256(value: Uint8Array | Buffer): Uint8Array;
|
390
|
+
static encodeUInt256(value: Uint8Array | Buffer): Uint8Array;
|
391
|
+
static encodeAddress(value: Uint8Array | Buffer): Uint8Array;
|
392
|
+
static encodeString(value: string): Uint8Array;
|
393
|
+
static encodeBytes(value: Uint8Array | Buffer): Uint8Array;
|
394
|
+
static encodeBytesDyn(value: Uint8Array | Buffer): Uint8Array;
|
395
|
+
static decodeUInt256(input: Uint8Array | Buffer): string;
|
396
|
+
static decodeValue(input: Uint8Array | Buffer, type: string): string;
|
397
|
+
static decodeArray(input: Uint8Array | Buffer, type: string): string;
|
434
398
|
}
|
435
|
-
export class
|
399
|
+
export class EthereumChainID {
|
436
400
|
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
|
-
|
401
|
+
static ethereum: EthereumChainID;
|
402
|
+
static classic: EthereumChainID;
|
403
|
+
static poa: EthereumChainID;
|
404
|
+
static vechain: EthereumChainID;
|
405
|
+
static callisto: EthereumChainID;
|
406
|
+
static tomochain: EthereumChainID;
|
407
|
+
static polygon: EthereumChainID;
|
408
|
+
static okc: EthereumChainID;
|
409
|
+
static thundertoken: EthereumChainID;
|
410
|
+
static gochain: EthereumChainID;
|
411
|
+
static meter: EthereumChainID;
|
412
|
+
static celo: EthereumChainID;
|
413
|
+
static wanchain: EthereumChainID;
|
414
|
+
static cronos: EthereumChainID;
|
415
|
+
static optimism: EthereumChainID;
|
416
|
+
static xdai: EthereumChainID;
|
417
|
+
static smartbch: EthereumChainID;
|
418
|
+
static fantom: EthereumChainID;
|
419
|
+
static zksync: EthereumChainID;
|
420
|
+
static boba: EthereumChainID;
|
421
|
+
static kcc: EthereumChainID;
|
422
|
+
static heco: EthereumChainID;
|
423
|
+
static metis: EthereumChainID;
|
424
|
+
static moonbeam: EthereumChainID;
|
425
|
+
static moonriver: EthereumChainID;
|
426
|
+
static ronin: EthereumChainID;
|
427
|
+
static kavaevm: EthereumChainID;
|
428
|
+
static klaytn: EthereumChainID;
|
429
|
+
static avalanchec: EthereumChainID;
|
430
|
+
static evmos: EthereumChainID;
|
431
|
+
static arbitrum: EthereumChainID;
|
432
|
+
static smartchain: EthereumChainID;
|
433
|
+
static aurora: EthereumChainID;
|
454
434
|
}
|
455
435
|
export class FIOAccount {
|
456
436
|
static createWithString(string: string): FIOAccount;
|
457
437
|
description(): string;
|
458
438
|
delete(): void;
|
459
439
|
}
|
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;
|
440
|
+
export class GroestlcoinAddress {
|
441
|
+
static equal(lhs: GroestlcoinAddress, rhs: GroestlcoinAddress): boolean;
|
442
|
+
static isValidString(string: string): boolean;
|
443
|
+
static createWithString(string: string): GroestlcoinAddress;
|
444
|
+
static createWithPublicKey(publicKey: PublicKey, prefix: number): GroestlcoinAddress;
|
490
445
|
description(): string;
|
491
446
|
delete(): void;
|
492
447
|
}
|
@@ -508,51 +463,66 @@ export class HDVersion {
|
|
508
463
|
static dgub: HDVersion;
|
509
464
|
static dgpv: HDVersion;
|
510
465
|
}
|
511
|
-
export class
|
512
|
-
static
|
513
|
-
static
|
514
|
-
static
|
515
|
-
static
|
466
|
+
export class HDWallet {
|
467
|
+
static getPublicKeyFromExtended(extended: string, coin: CoinType, derivationPath: string): PublicKey;
|
468
|
+
static create(strength: number, passphrase: string): HDWallet;
|
469
|
+
static createWithMnemonic(mnemonic: string, passphrase: string): HDWallet;
|
470
|
+
static createWithMnemonicCheck(mnemonic: string, passphrase: string, check: boolean): HDWallet;
|
471
|
+
static createWithEntropy(entropy: Uint8Array | Buffer, passphrase: string): HDWallet;
|
472
|
+
seed(): Uint8Array;
|
473
|
+
mnemonic(): string;
|
474
|
+
entropy(): Uint8Array;
|
475
|
+
getMasterKey(curve: Curve): PrivateKey;
|
476
|
+
getKeyForCoin(coin: CoinType): PrivateKey;
|
477
|
+
getAddressForCoin(coin: CoinType): string;
|
478
|
+
getAddressDerivation(coin: CoinType, derivation: Derivation): string;
|
479
|
+
getKey(coin: CoinType, derivationPath: string): PrivateKey;
|
480
|
+
getKeyDerivation(coin: CoinType, derivation: Derivation): PrivateKey;
|
481
|
+
getKeyByCurve(curve: Curve, derivationPath: string): PrivateKey;
|
482
|
+
getDerivedKey(coin: CoinType, account: number, change: number, address: number): PrivateKey;
|
483
|
+
getExtendedPrivateKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
484
|
+
getExtendedPublicKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
485
|
+
getExtendedPrivateKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
486
|
+
getExtendedPublicKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
487
|
+
getExtendedPrivateKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
488
|
+
getExtendedPublicKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
489
|
+
delete(): void;
|
516
490
|
}
|
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 {
|
491
|
+
export class HRP {
|
550
492
|
value: number;
|
551
|
-
static
|
552
|
-
static
|
493
|
+
static unknown: HRP;
|
494
|
+
static bitcoin: HRP;
|
495
|
+
static litecoin: HRP;
|
496
|
+
static viacoin: HRP;
|
497
|
+
static groestlcoin: HRP;
|
498
|
+
static digiByte: HRP;
|
499
|
+
static monacoin: HRP;
|
500
|
+
static cosmos: HRP;
|
501
|
+
static bitcoinCash: HRP;
|
502
|
+
static bitcoinGold: HRP;
|
503
|
+
static ioTeX: HRP;
|
504
|
+
static nervos: HRP;
|
505
|
+
static zilliqa: HRP;
|
506
|
+
static terra: HRP;
|
507
|
+
static cryptoOrg: HRP;
|
508
|
+
static kava: HRP;
|
509
|
+
static oasis: HRP;
|
510
|
+
static bluzelle: HRP;
|
511
|
+
static bandChain: HRP;
|
512
|
+
static elrond: HRP;
|
513
|
+
static secret: HRP;
|
514
|
+
static binance: HRP;
|
515
|
+
static ecash: HRP;
|
516
|
+
static thorchain: HRP;
|
517
|
+
static harmony: HRP;
|
518
|
+
static cardano: HRP;
|
519
|
+
static qtum: HRP;
|
520
|
+
static osmosis: HRP;
|
521
|
+
static terraV2: HRP;
|
522
|
+
static nativeEvmos: HRP;
|
553
523
|
}
|
554
524
|
|
555
|
-
declare function
|
525
|
+
declare function describeHRP(value: HRP): string;
|
556
526
|
|
557
527
|
export class Hash {
|
558
528
|
static sha1(data: Uint8Array | Buffer): Uint8Array;
|
@@ -574,12 +544,14 @@ export class Hash {
|
|
574
544
|
static blake256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
575
545
|
static groestl512Groestl512(data: Uint8Array | Buffer): Uint8Array;
|
576
546
|
}
|
577
|
-
export class
|
578
|
-
static
|
579
|
-
static
|
580
|
-
|
581
|
-
|
582
|
-
|
547
|
+
export class Mnemonic {
|
548
|
+
static isValid(mnemonic: string): boolean;
|
549
|
+
static isValidWord(word: string): boolean;
|
550
|
+
static suggest(prefix: string): string;
|
551
|
+
}
|
552
|
+
export class NEARAccount {
|
553
|
+
static createWithString(string: string): NEARAccount;
|
554
|
+
description(): string;
|
583
555
|
delete(): void;
|
584
556
|
}
|
585
557
|
export class NervosAddress {
|
@@ -592,201 +564,231 @@ export class NervosAddress {
|
|
592
564
|
args(): Uint8Array;
|
593
565
|
delete(): void;
|
594
566
|
}
|
595
|
-
export class
|
567
|
+
export class PBKDF2 {
|
568
|
+
static hmacSha256(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
569
|
+
static hmacSha512(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
570
|
+
}
|
571
|
+
export class PrivateKey {
|
572
|
+
static isValid(data: Uint8Array | Buffer, curve: Curve): boolean;
|
573
|
+
static create(): PrivateKey;
|
574
|
+
static createWithData(data: Uint8Array | Buffer): PrivateKey;
|
575
|
+
static createCopy(key: PrivateKey): PrivateKey;
|
576
|
+
data(): Uint8Array;
|
577
|
+
getPublicKey(coinType: CoinType): PublicKey;
|
578
|
+
getPublicKeyByType(pubkeyType: PublicKeyType): PublicKey;
|
579
|
+
getPublicKeySecp256k1(compressed: boolean): PublicKey;
|
580
|
+
getPublicKeyNist256p1(): PublicKey;
|
581
|
+
getPublicKeyEd25519(): PublicKey;
|
582
|
+
getPublicKeyEd25519Blake2b(): PublicKey;
|
583
|
+
getPublicKeyEd25519Cardano(): PublicKey;
|
584
|
+
getPublicKeyCurve25519(): PublicKey;
|
585
|
+
getSharedKey(publicKey: PublicKey, curve: Curve): Uint8Array;
|
586
|
+
sign(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
587
|
+
signAsDER(digest: Uint8Array | Buffer): Uint8Array;
|
588
|
+
signZilliqaSchnorr(message: Uint8Array | Buffer): Uint8Array;
|
589
|
+
delete(): void;
|
590
|
+
}
|
591
|
+
export class PrivateKeyType {
|
596
592
|
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;
|
593
|
+
static default: PrivateKeyType;
|
594
|
+
static cardano: PrivateKeyType;
|
630
595
|
}
|
631
|
-
export class
|
596
|
+
export class PublicKey {
|
597
|
+
static isValid(data: Uint8Array | Buffer, type: PublicKeyType): boolean;
|
598
|
+
static recover(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): PublicKey;
|
599
|
+
static createWithData(data: Uint8Array | Buffer, type: PublicKeyType): PublicKey;
|
600
|
+
isCompressed(): boolean;
|
601
|
+
compressed(): PublicKey;
|
602
|
+
uncompressed(): PublicKey;
|
603
|
+
data(): Uint8Array;
|
604
|
+
keyType(): PublicKeyType;
|
605
|
+
description(): string;
|
606
|
+
verify(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
607
|
+
verifyAsDER(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
608
|
+
verifyZilliqaSchnorr(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
609
|
+
delete(): void;
|
610
|
+
}
|
611
|
+
export class PublicKeyType {
|
632
612
|
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;
|
613
|
+
static secp256k1: PublicKeyType;
|
614
|
+
static secp256k1Extended: PublicKeyType;
|
615
|
+
static nist256p1: PublicKeyType;
|
616
|
+
static nist256p1Extended: PublicKeyType;
|
617
|
+
static ed25519: PublicKeyType;
|
618
|
+
static ed25519Blake2b: PublicKeyType;
|
619
|
+
static curve25519: PublicKeyType;
|
620
|
+
static ed25519Cardano: PublicKeyType;
|
729
621
|
}
|
730
|
-
export class
|
731
|
-
|
732
|
-
static
|
733
|
-
static
|
734
|
-
static
|
622
|
+
export class Purpose {
|
623
|
+
value: number;
|
624
|
+
static bip44: Purpose;
|
625
|
+
static bip49: Purpose;
|
626
|
+
static bip84: Purpose;
|
627
|
+
static bip1852: Purpose;
|
628
|
+
}
|
629
|
+
export class RippleXAddress {
|
630
|
+
static equal(lhs: RippleXAddress, rhs: RippleXAddress): boolean;
|
631
|
+
static isValidString(string: string): boolean;
|
632
|
+
static createWithString(string: string): RippleXAddress;
|
633
|
+
static createWithPublicKey(publicKey: PublicKey, tag: number): RippleXAddress;
|
634
|
+
description(): string;
|
635
|
+
tag(): number;
|
636
|
+
delete(): void;
|
637
|
+
}
|
638
|
+
export class SS58AddressType {
|
639
|
+
value: number;
|
640
|
+
static polkadot: SS58AddressType;
|
641
|
+
static kusama: SS58AddressType;
|
642
|
+
}
|
643
|
+
export class SegwitAddress {
|
644
|
+
static equal(lhs: SegwitAddress, rhs: SegwitAddress): boolean;
|
645
|
+
static isValidString(string: string): boolean;
|
646
|
+
static createWithString(string: string): SegwitAddress;
|
647
|
+
static createWithPublicKey(hrp: HRP, publicKey: PublicKey): SegwitAddress;
|
648
|
+
description(): string;
|
649
|
+
hrp(): HRP;
|
650
|
+
witnessVersion(): number;
|
651
|
+
witnessProgram(): Uint8Array;
|
652
|
+
delete(): void;
|
653
|
+
}
|
654
|
+
export class SolanaAddress {
|
655
|
+
static createWithString(string: string): SolanaAddress;
|
656
|
+
description(): string;
|
657
|
+
defaultTokenAddress(tokenMintAddress: string): string;
|
658
|
+
delete(): void;
|
659
|
+
}
|
660
|
+
export class StellarMemoType {
|
661
|
+
value: number;
|
662
|
+
static none: StellarMemoType;
|
663
|
+
static text: StellarMemoType;
|
664
|
+
static id: StellarMemoType;
|
665
|
+
static hash: StellarMemoType;
|
666
|
+
static return: StellarMemoType;
|
667
|
+
}
|
668
|
+
export class StellarPassphrase {
|
669
|
+
value: number;
|
670
|
+
static stellar: StellarPassphrase;
|
671
|
+
static kin: StellarPassphrase;
|
672
|
+
}
|
673
|
+
|
674
|
+
declare function describeStellarPassphrase(value: StellarPassphrase): string;
|
675
|
+
|
676
|
+
export class StellarVersionByte {
|
677
|
+
value: number;
|
678
|
+
static accountID: StellarVersionByte;
|
679
|
+
static seed: StellarVersionByte;
|
680
|
+
static preAuthTX: StellarVersionByte;
|
681
|
+
static sha256Hash: StellarVersionByte;
|
682
|
+
}
|
683
|
+
export class StoredKey {
|
684
|
+
static load(path: string): StoredKey;
|
685
|
+
static importPrivateKey(privateKey: Uint8Array | Buffer, name: string, password: Uint8Array | Buffer, coin: CoinType): StoredKey;
|
686
|
+
static importPrivateKeyWithEncryption(privateKey: Uint8Array | Buffer, name: string, password: Uint8Array | Buffer, coin: CoinType, encryption: StoredKeyEncryption): StoredKey;
|
687
|
+
static importHDWallet(mnemonic: string, name: string, password: Uint8Array | Buffer, coin: CoinType): StoredKey;
|
688
|
+
static importHDWalletWithEncryption(mnemonic: string, name: string, password: Uint8Array | Buffer, coin: CoinType, encryption: StoredKeyEncryption): StoredKey;
|
689
|
+
static importJSON(json: Uint8Array | Buffer): StoredKey;
|
690
|
+
static createLevel(name: string, password: Uint8Array | Buffer, encryptionLevel: StoredKeyEncryptionLevel): StoredKey;
|
691
|
+
static createLevelAndEncryption(name: string, password: Uint8Array | Buffer, encryptionLevel: StoredKeyEncryptionLevel, encryption: StoredKeyEncryption): StoredKey;
|
692
|
+
static create(name: string, password: Uint8Array | Buffer): StoredKey;
|
693
|
+
static createEncryption(name: string, password: Uint8Array | Buffer, encryption: StoredKeyEncryption): StoredKey;
|
694
|
+
identifier(): string;
|
695
|
+
name(): string;
|
696
|
+
isMnemonic(): boolean;
|
697
|
+
accountCount(): number;
|
698
|
+
encryptionParameters(): string;
|
699
|
+
account(index: number): Account;
|
700
|
+
accountForCoin(coin: CoinType, wallet: HDWallet): Account;
|
701
|
+
accountForCoinDerivation(coin: CoinType, derivation: Derivation, wallet: HDWallet): Account;
|
702
|
+
addAccountDerivation(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
|
703
|
+
addAccount(address: string, coin: CoinType, derivationPath: string, publicKey: string, extendedPublicKey: string): void;
|
704
|
+
removeAccountForCoin(coin: CoinType): void;
|
705
|
+
removeAccountForCoinDerivation(coin: CoinType, derivation: Derivation): void;
|
706
|
+
removeAccountForCoinDerivationPath(coin: CoinType, derivationPath: string): void;
|
707
|
+
store(path: string): boolean;
|
708
|
+
decryptPrivateKey(password: Uint8Array | Buffer): Uint8Array;
|
709
|
+
decryptMnemonic(password: Uint8Array | Buffer): string;
|
710
|
+
privateKey(coin: CoinType, password: Uint8Array | Buffer): PrivateKey;
|
711
|
+
wallet(password: Uint8Array | Buffer): HDWallet;
|
712
|
+
exportJSON(): Uint8Array;
|
713
|
+
fixAddresses(password: Uint8Array | Buffer): boolean;
|
714
|
+
delete(): void;
|
715
|
+
}
|
716
|
+
export class StoredKeyEncryption {
|
717
|
+
value: number;
|
718
|
+
static aes128Ctr: StoredKeyEncryption;
|
719
|
+
static aes128Cbc: StoredKeyEncryption;
|
720
|
+
static aes192Ctr: StoredKeyEncryption;
|
721
|
+
static aes256Ctr: StoredKeyEncryption;
|
722
|
+
}
|
723
|
+
export class StoredKeyEncryptionLevel {
|
724
|
+
value: number;
|
725
|
+
static default: StoredKeyEncryptionLevel;
|
726
|
+
static minimal: StoredKeyEncryptionLevel;
|
727
|
+
static weak: StoredKeyEncryptionLevel;
|
728
|
+
static standard: StoredKeyEncryptionLevel;
|
729
|
+
}
|
730
|
+
export class THORChainSwap {
|
731
|
+
static buildSwap(input: Uint8Array | Buffer): Uint8Array;
|
732
|
+
}
|
733
|
+
export class TransactionCompiler {
|
734
|
+
static buildInput(coinType: CoinType, from: string, to: string, amount: string, asset: string, memo: string, chainId: string): Uint8Array;
|
735
|
+
static preImageHashes(coinType: CoinType, txInputData: Uint8Array | Buffer): Uint8Array;
|
736
|
+
static compileWithSignatures(coinType: CoinType, txInputData: Uint8Array | Buffer, signatures: DataVector, publicKeys: DataVector): Uint8Array;
|
735
737
|
}
|
736
738
|
export interface WalletCore {
|
737
|
-
HexCoding: typeof HexCoding;
|
738
739
|
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;
|
740
|
+
HexCoding: typeof HexCoding;
|
741
|
+
AES: typeof AES;
|
752
742
|
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;
|
743
|
+
Account: typeof Account;
|
761
744
|
AnyAddress: typeof AnyAddress;
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
745
|
+
Base32: typeof Base32;
|
746
|
+
Base58: typeof Base58;
|
747
|
+
Base64: typeof Base64;
|
748
|
+
BitcoinAddress: typeof BitcoinAddress;
|
749
|
+
BitcoinMessageSigner: typeof BitcoinMessageSigner;
|
750
|
+
BitcoinScript: typeof BitcoinScript;
|
766
751
|
BitcoinSigHashType: typeof BitcoinSigHashType;
|
752
|
+
Blockchain: typeof Blockchain;
|
767
753
|
Cardano: typeof Cardano;
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
754
|
+
CoinType: typeof CoinType;
|
755
|
+
CoinTypeConfiguration: typeof CoinTypeConfiguration;
|
756
|
+
Curve: typeof Curve;
|
757
|
+
DataVector: typeof DataVector;
|
758
|
+
Derivation: typeof Derivation;
|
759
|
+
DerivationPath: typeof DerivationPath;
|
772
760
|
DerivationPathIndex: typeof DerivationPathIndex;
|
773
|
-
FIOAccount: typeof FIOAccount;
|
774
761
|
EthereumAbi: typeof EthereumAbi;
|
762
|
+
EthereumAbiFunction: typeof EthereumAbiFunction;
|
763
|
+
EthereumAbiValue: typeof EthereumAbiValue;
|
764
|
+
EthereumChainID: typeof EthereumChainID;
|
765
|
+
FIOAccount: typeof FIOAccount;
|
766
|
+
GroestlcoinAddress: typeof GroestlcoinAddress;
|
767
|
+
HDVersion: typeof HDVersion;
|
768
|
+
HDWallet: typeof HDWallet;
|
769
|
+
HRP: typeof HRP;
|
770
|
+
Hash: typeof Hash;
|
775
771
|
Mnemonic: typeof Mnemonic;
|
776
|
-
DerivationPath: typeof DerivationPath;
|
777
|
-
BitcoinMessageSigner: typeof BitcoinMessageSigner;
|
778
772
|
NEARAccount: typeof NEARAccount;
|
779
|
-
|
780
|
-
|
781
|
-
|
773
|
+
NervosAddress: typeof NervosAddress;
|
774
|
+
PBKDF2: typeof PBKDF2;
|
775
|
+
PrivateKey: typeof PrivateKey;
|
776
|
+
PrivateKeyType: typeof PrivateKeyType;
|
777
|
+
PublicKey: typeof PublicKey;
|
778
|
+
PublicKeyType: typeof PublicKeyType;
|
779
|
+
Purpose: typeof Purpose;
|
780
|
+
RippleXAddress: typeof RippleXAddress;
|
782
781
|
SS58AddressType: typeof SS58AddressType;
|
782
|
+
SegwitAddress: typeof SegwitAddress;
|
783
|
+
SolanaAddress: typeof SolanaAddress;
|
784
|
+
StellarMemoType: typeof StellarMemoType;
|
783
785
|
StellarPassphrase: typeof StellarPassphrase;
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
786
|
+
StellarVersionByte: typeof StellarVersionByte;
|
787
|
+
StoredKey: typeof StoredKey;
|
788
|
+
StoredKeyEncryption: typeof StoredKeyEncryption;
|
789
|
+
StoredKeyEncryptionLevel: typeof StoredKeyEncryptionLevel;
|
790
|
+
THORChainSwap: typeof THORChainSwap;
|
791
|
+
TransactionCompiler: typeof TransactionCompiler;
|
790
792
|
describeCurve: typeof describeCurve;
|
791
793
|
describeHRP: typeof describeHRP;
|
792
794
|
describeStellarPassphrase: typeof describeStellarPassphrase;
|