@trustwallet/wallet-core 2.9.5 → 2.9.8
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/generated/core_proto.d.ts +312 -3
- package/dist/generated/core_proto.js +1073 -151
- package/dist/index.d.ts +2 -3
- package/dist/index.js +16 -7
- package/dist/lib/wallet-core.d.ts +395 -381
- package/dist/lib/wallet-core.js +69 -69
- package/dist/lib/wallet-core.wasm +0 -0
- package/package.json +6 -4
@@ -15,95 +15,10 @@ export namespace HexCoding {
|
|
15
15
|
export function decode(hex: string): Uint8Array;
|
16
16
|
export function encode(buffer: Uint8Array | Buffer): string;
|
17
17
|
}
|
18
|
-
export class
|
19
|
-
static getPublicKeyFromExtended(extended: string, coin: CoinType, derivationPath: string): PublicKey;
|
20
|
-
static create(strength: number, passphrase: string): HDWallet;
|
21
|
-
static createWithMnemonic(mnemonic: string, passphrase: string): HDWallet;
|
22
|
-
static createWithMnemonicCheck(mnemonic: string, passphrase: string, check: boolean): HDWallet;
|
23
|
-
static createWithEntropy(entropy: Uint8Array | Buffer, passphrase: string): HDWallet;
|
24
|
-
seed(): Uint8Array;
|
25
|
-
mnemonic(): string;
|
26
|
-
entropy(): Uint8Array;
|
27
|
-
getMasterKey(curve: Curve): PrivateKey;
|
28
|
-
getKeyForCoin(coin: CoinType): PrivateKey;
|
29
|
-
getAddressForCoin(coin: CoinType): string;
|
30
|
-
getKey(coin: CoinType, derivationPath: string): PrivateKey;
|
31
|
-
getDerivedKey(coin: CoinType, account: number, change: number, address: number): PrivateKey;
|
32
|
-
getExtendedPrivateKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
33
|
-
getExtendedPublicKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
34
|
-
getExtendedPrivateKeyAccount(purpose: Purpose, coin: CoinType, version: HDVersion, account: number): string;
|
35
|
-
getExtendedPublicKeyAccount(purpose: Purpose, coin: CoinType, version: HDVersion, account: number): string;
|
36
|
-
delete(): void;
|
37
|
-
}
|
38
|
-
export class SolanaAddress {
|
39
|
-
static createWithString(string: string): SolanaAddress;
|
40
|
-
description(): string;
|
41
|
-
defaultTokenAddress(tokenMintAddress: string): string;
|
42
|
-
delete(): void;
|
43
|
-
}
|
44
|
-
export class PrivateKey {
|
45
|
-
static isValid(data: Uint8Array | Buffer, curve: Curve): boolean;
|
46
|
-
static create(): PrivateKey;
|
47
|
-
static createWithData(data: Uint8Array | Buffer): PrivateKey;
|
48
|
-
static createCopy(key: PrivateKey): PrivateKey;
|
49
|
-
data(): Uint8Array;
|
50
|
-
getPublicKeySecp256k1(compressed: boolean): PublicKey;
|
51
|
-
getPublicKeyNist256p1(): PublicKey;
|
52
|
-
getPublicKeyEd25519(): PublicKey;
|
53
|
-
getPublicKeyEd25519Blake2b(): PublicKey;
|
54
|
-
getPublicKeyEd25519Extended(): PublicKey;
|
55
|
-
getPublicKeyCurve25519(): PublicKey;
|
56
|
-
getSharedKey(publicKey: PublicKey, curve: Curve): Uint8Array;
|
57
|
-
sign(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
58
|
-
signAsDER(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
59
|
-
signSchnorr(message: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
60
|
-
delete(): void;
|
61
|
-
}
|
62
|
-
export class BitcoinScript {
|
63
|
-
static equal(lhs: BitcoinScript, rhs: BitcoinScript): boolean;
|
64
|
-
static buildPayToPublicKey(pubkey: Uint8Array | Buffer): BitcoinScript;
|
65
|
-
static buildPayToPublicKeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
66
|
-
static buildPayToScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
67
|
-
static buildPayToWitnessPubkeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
68
|
-
static buildPayToWitnessScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
69
|
-
static lockScriptForAddress(address: string, coin: CoinType): BitcoinScript;
|
70
|
-
static hashTypeForCoin(coinType: CoinType): number;
|
71
|
-
static create(): BitcoinScript;
|
72
|
-
static createWithData(data: Uint8Array | Buffer): BitcoinScript;
|
73
|
-
static createCopy(script: BitcoinScript): BitcoinScript;
|
74
|
-
size(): number;
|
75
|
-
data(): Uint8Array;
|
76
|
-
scriptHash(): Uint8Array;
|
77
|
-
isPayToScriptHash(): boolean;
|
78
|
-
isPayToWitnessScriptHash(): boolean;
|
79
|
-
isPayToWitnessPublicKeyHash(): boolean;
|
80
|
-
isWitnessProgram(): boolean;
|
81
|
-
matchPayToPubkey(): Uint8Array;
|
82
|
-
matchPayToPubkeyHash(): Uint8Array;
|
83
|
-
matchPayToScriptHash(): Uint8Array;
|
84
|
-
matchPayToWitnessPublicKeyHash(): Uint8Array;
|
85
|
-
matchPayToWitnessScriptHash(): Uint8Array;
|
86
|
-
encode(): Uint8Array;
|
87
|
-
delete(): void;
|
88
|
-
}
|
89
|
-
export class Derivation {
|
18
|
+
export class SS58AddressType {
|
90
19
|
value: number;
|
91
|
-
static
|
92
|
-
static
|
93
|
-
static bitcoinSegwit: Derivation;
|
94
|
-
static bitcoinLegacy: Derivation;
|
95
|
-
static litecoinLegacy: Derivation;
|
96
|
-
static solanaSolana: Derivation;
|
97
|
-
}
|
98
|
-
export class AnyAddress {
|
99
|
-
static equal(lhs: AnyAddress, rhs: AnyAddress): boolean;
|
100
|
-
static isValid(string: string, coin: CoinType): boolean;
|
101
|
-
static createWithString(string: string, coin: CoinType): AnyAddress;
|
102
|
-
static createWithPublicKey(publicKey: PublicKey, coin: CoinType): AnyAddress;
|
103
|
-
description(): string;
|
104
|
-
coin(): CoinType;
|
105
|
-
data(): Uint8Array;
|
106
|
-
delete(): void;
|
20
|
+
static polkadot: SS58AddressType;
|
21
|
+
static kusama: SS58AddressType;
|
107
22
|
}
|
108
23
|
export class Account {
|
109
24
|
static create(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): Account;
|
@@ -115,58 +30,120 @@ export class Account {
|
|
115
30
|
coin(): CoinType;
|
116
31
|
delete(): void;
|
117
32
|
}
|
118
|
-
export class
|
119
|
-
static
|
120
|
-
static createWithData(data: Uint8Array | Buffer): DataVector;
|
121
|
-
size(): number;
|
122
|
-
add(data: Uint8Array | Buffer): void;
|
123
|
-
get(index: number): Uint8Array;
|
124
|
-
delete(): void;
|
125
|
-
}
|
126
|
-
export class Curve {
|
127
|
-
value: number;
|
128
|
-
static secp256k1: Curve;
|
129
|
-
static ed25519: Curve;
|
130
|
-
static ed25519Blake2bNano: Curve;
|
131
|
-
static curve25519: Curve;
|
132
|
-
static nist256p1: Curve;
|
133
|
-
static ed25519Extended: Curve;
|
134
|
-
}
|
135
|
-
|
136
|
-
declare function describeCurve(value: Curve): string;
|
137
|
-
|
138
|
-
export class RippleXAddress {
|
139
|
-
static equal(lhs: RippleXAddress, rhs: RippleXAddress): boolean;
|
33
|
+
export class GroestlcoinAddress {
|
34
|
+
static equal(lhs: GroestlcoinAddress, rhs: GroestlcoinAddress): boolean;
|
140
35
|
static isValidString(string: string): boolean;
|
141
|
-
static createWithString(string: string):
|
142
|
-
static createWithPublicKey(publicKey: PublicKey,
|
36
|
+
static createWithString(string: string): GroestlcoinAddress;
|
37
|
+
static createWithPublicKey(publicKey: PublicKey, prefix: number): GroestlcoinAddress;
|
143
38
|
description(): string;
|
144
|
-
tag(): number;
|
145
39
|
delete(): void;
|
146
40
|
}
|
147
|
-
export class
|
148
|
-
|
149
|
-
static
|
150
|
-
static
|
151
|
-
static
|
152
|
-
static
|
153
|
-
static
|
154
|
-
static
|
155
|
-
static
|
156
|
-
static
|
157
|
-
static
|
158
|
-
static
|
159
|
-
static
|
41
|
+
export class CoinType {
|
42
|
+
value: number;
|
43
|
+
static aeternity: CoinType;
|
44
|
+
static aion: CoinType;
|
45
|
+
static binance: CoinType;
|
46
|
+
static bitcoin: CoinType;
|
47
|
+
static bitcoinCash: CoinType;
|
48
|
+
static bitcoinGold: CoinType;
|
49
|
+
static callisto: CoinType;
|
50
|
+
static cardano: CoinType;
|
51
|
+
static cosmos: CoinType;
|
52
|
+
static dash: CoinType;
|
53
|
+
static decred: CoinType;
|
54
|
+
static digiByte: CoinType;
|
55
|
+
static dogecoin: CoinType;
|
56
|
+
static eos: CoinType;
|
57
|
+
static ethereum: CoinType;
|
58
|
+
static ethereumClassic: CoinType;
|
59
|
+
static fio: CoinType;
|
60
|
+
static goChain: CoinType;
|
61
|
+
static groestlcoin: CoinType;
|
62
|
+
static icon: CoinType;
|
63
|
+
static ioTeX: CoinType;
|
64
|
+
static kava: CoinType;
|
65
|
+
static kin: CoinType;
|
66
|
+
static litecoin: CoinType;
|
67
|
+
static monacoin: CoinType;
|
68
|
+
static nebulas: CoinType;
|
69
|
+
static nuls: CoinType;
|
70
|
+
static nano: CoinType;
|
71
|
+
static near: CoinType;
|
72
|
+
static nimiq: CoinType;
|
73
|
+
static ontology: CoinType;
|
74
|
+
static poanetwork: CoinType;
|
75
|
+
static qtum: CoinType;
|
76
|
+
static xrp: CoinType;
|
77
|
+
static solana: CoinType;
|
78
|
+
static stellar: CoinType;
|
79
|
+
static tezos: CoinType;
|
80
|
+
static theta: CoinType;
|
81
|
+
static thunderToken: CoinType;
|
82
|
+
static neo: CoinType;
|
83
|
+
static tomoChain: CoinType;
|
84
|
+
static tron: CoinType;
|
85
|
+
static veChain: CoinType;
|
86
|
+
static viacoin: CoinType;
|
87
|
+
static wanchain: CoinType;
|
88
|
+
static zcash: CoinType;
|
89
|
+
static firo: CoinType;
|
90
|
+
static zilliqa: CoinType;
|
91
|
+
static zelcash: CoinType;
|
92
|
+
static ravencoin: CoinType;
|
93
|
+
static waves: CoinType;
|
94
|
+
static terra: CoinType;
|
95
|
+
static terraV2: CoinType;
|
96
|
+
static harmony: CoinType;
|
97
|
+
static algorand: CoinType;
|
98
|
+
static kusama: CoinType;
|
99
|
+
static polkadot: CoinType;
|
100
|
+
static filecoin: CoinType;
|
101
|
+
static elrond: CoinType;
|
102
|
+
static bandChain: CoinType;
|
103
|
+
static smartChainLegacy: CoinType;
|
104
|
+
static smartChain: CoinType;
|
105
|
+
static oasis: CoinType;
|
106
|
+
static polygon: CoinType;
|
107
|
+
static thorchain: CoinType;
|
108
|
+
static bluzelle: CoinType;
|
109
|
+
static optimism: CoinType;
|
110
|
+
static arbitrum: CoinType;
|
111
|
+
static ecochain: CoinType;
|
112
|
+
static avalancheCChain: CoinType;
|
113
|
+
static xdai: CoinType;
|
114
|
+
static fantom: CoinType;
|
115
|
+
static cryptoOrg: CoinType;
|
116
|
+
static celo: CoinType;
|
117
|
+
static ronin: CoinType;
|
118
|
+
static osmosis: CoinType;
|
119
|
+
static ecash: CoinType;
|
120
|
+
static cronosChain: CoinType;
|
121
|
+
static smartBitcoinCash: CoinType;
|
122
|
+
static kuCoinCommunityChain: CoinType;
|
123
|
+
static boba: CoinType;
|
124
|
+
static metis: CoinType;
|
125
|
+
static aurora: CoinType;
|
126
|
+
static evmos: CoinType;
|
127
|
+
static nativeEvmos: CoinType;
|
128
|
+
static moonriver: CoinType;
|
129
|
+
static moonbeam: CoinType;
|
130
|
+
static kavaEvm: CoinType;
|
131
|
+
static klaytn: CoinType;
|
132
|
+
static meter: CoinType;
|
133
|
+
}
|
134
|
+
export class Cardano {
|
135
|
+
static minAdaAmount(tokenBundle: Uint8Array | Buffer): number;
|
160
136
|
}
|
161
137
|
export class TransactionCompiler {
|
162
138
|
static buildInput(coinType: CoinType, from: string, to: string, amount: string, asset: string, memo: string, chainId: string): Uint8Array;
|
163
139
|
static preImageHashes(coinType: CoinType, txInputData: Uint8Array | Buffer): Uint8Array;
|
164
140
|
static compileWithSignatures(coinType: CoinType, txInputData: Uint8Array | Buffer, signatures: DataVector, publicKeys: DataVector): Uint8Array;
|
165
141
|
}
|
166
|
-
export class
|
167
|
-
|
168
|
-
|
169
|
-
|
142
|
+
export class SolanaAddress {
|
143
|
+
static createWithString(string: string): SolanaAddress;
|
144
|
+
description(): string;
|
145
|
+
defaultTokenAddress(tokenMintAddress: string): string;
|
146
|
+
delete(): void;
|
170
147
|
}
|
171
148
|
export class EthereumAbi {
|
172
149
|
static encode(fn: EthereumAbiFunction): Uint8Array;
|
@@ -174,61 +151,12 @@ export class EthereumAbi {
|
|
174
151
|
static decodeCall(data: Uint8Array | Buffer, abi: string): string;
|
175
152
|
static encodeTyped(messageJson: string): Uint8Array;
|
176
153
|
}
|
177
|
-
export class
|
178
|
-
static hmacSha256(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
179
|
-
static hmacSha512(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
180
|
-
}
|
181
|
-
export class FIOAccount {
|
182
|
-
static createWithString(string: string): FIOAccount;
|
183
|
-
description(): string;
|
184
|
-
delete(): void;
|
185
|
-
}
|
186
|
-
export class HRP {
|
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 zilliqa: HRP;
|
200
|
-
static terra: HRP;
|
201
|
-
static cryptoOrg: HRP;
|
202
|
-
static kava: HRP;
|
203
|
-
static oasis: HRP;
|
204
|
-
static bluzelle: HRP;
|
205
|
-
static bandChain: HRP;
|
206
|
-
static elrond: HRP;
|
207
|
-
static binance: HRP;
|
208
|
-
static ecash: HRP;
|
209
|
-
static thorchain: HRP;
|
210
|
-
static harmony: HRP;
|
211
|
-
static cardano: HRP;
|
212
|
-
static qtum: HRP;
|
213
|
-
static osmosis: HRP;
|
214
|
-
static nativeEvmos: HRP;
|
215
|
-
}
|
216
|
-
|
217
|
-
declare function describeHRP(value: HRP): string;
|
218
|
-
|
219
|
-
export class AES {
|
220
|
-
static encryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
221
|
-
static decryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
222
|
-
static encryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
223
|
-
static decryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
224
|
-
}
|
225
|
-
export class SS58AddressType {
|
154
|
+
export class StellarVersionByte {
|
226
155
|
value: number;
|
227
|
-
static
|
228
|
-
static
|
229
|
-
|
230
|
-
|
231
|
-
static buildSwap(input: Uint8Array | Buffer): Uint8Array;
|
156
|
+
static accountID: StellarVersionByte;
|
157
|
+
static seed: StellarVersionByte;
|
158
|
+
static preAuthTX: StellarVersionByte;
|
159
|
+
static sha256Hash: StellarVersionByte;
|
232
160
|
}
|
233
161
|
export class Blockchain {
|
234
162
|
value: number;
|
@@ -272,12 +200,43 @@ export class Blockchain {
|
|
272
200
|
static ronin: Blockchain;
|
273
201
|
static kusama: Blockchain;
|
274
202
|
}
|
275
|
-
export class
|
276
|
-
|
277
|
-
static
|
278
|
-
static
|
279
|
-
static
|
280
|
-
|
203
|
+
export class StellarMemoType {
|
204
|
+
value: number;
|
205
|
+
static none: StellarMemoType;
|
206
|
+
static text: StellarMemoType;
|
207
|
+
static id: StellarMemoType;
|
208
|
+
static hash: StellarMemoType;
|
209
|
+
static return: StellarMemoType;
|
210
|
+
}
|
211
|
+
export class AESPaddingMode {
|
212
|
+
value: number;
|
213
|
+
static zero: AESPaddingMode;
|
214
|
+
static pkcs7: AESPaddingMode;
|
215
|
+
}
|
216
|
+
export class PrivateKey {
|
217
|
+
static isValid(data: Uint8Array | Buffer, curve: Curve): boolean;
|
218
|
+
static create(): PrivateKey;
|
219
|
+
static createWithData(data: Uint8Array | Buffer): PrivateKey;
|
220
|
+
static createCopy(key: PrivateKey): PrivateKey;
|
221
|
+
data(): Uint8Array;
|
222
|
+
getPublicKeySecp256k1(compressed: boolean): PublicKey;
|
223
|
+
getPublicKeyNist256p1(): PublicKey;
|
224
|
+
getPublicKeyEd25519(): PublicKey;
|
225
|
+
getPublicKeyEd25519Blake2b(): PublicKey;
|
226
|
+
getPublicKeyEd25519Extended(): PublicKey;
|
227
|
+
getPublicKeyCurve25519(): PublicKey;
|
228
|
+
getSharedKey(publicKey: PublicKey, curve: Curve): Uint8Array;
|
229
|
+
sign(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
230
|
+
signAsDER(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
231
|
+
signSchnorr(message: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
232
|
+
delete(): void;
|
233
|
+
}
|
234
|
+
export class DataVector {
|
235
|
+
static create(): DataVector;
|
236
|
+
static createWithData(data: Uint8Array | Buffer): DataVector;
|
237
|
+
size(): number;
|
238
|
+
add(data: Uint8Array | Buffer): void;
|
239
|
+
get(index: number): Uint8Array;
|
281
240
|
delete(): void;
|
282
241
|
}
|
283
242
|
export class HDVersion {
|
@@ -298,17 +257,54 @@ export class HDVersion {
|
|
298
257
|
static dgub: HDVersion;
|
299
258
|
static dgpv: HDVersion;
|
300
259
|
}
|
301
|
-
export class
|
260
|
+
export class Base32 {
|
261
|
+
static decodeWithAlphabet(string: string, alphabet: string): Uint8Array;
|
262
|
+
static decode(string: string): Uint8Array;
|
263
|
+
static encodeWithAlphabet(data: Uint8Array | Buffer, alphabet: string): string;
|
264
|
+
static encode(data: Uint8Array | Buffer): string;
|
265
|
+
}
|
266
|
+
export class BitcoinScript {
|
267
|
+
static equal(lhs: BitcoinScript, rhs: BitcoinScript): boolean;
|
268
|
+
static buildPayToPublicKey(pubkey: Uint8Array | Buffer): BitcoinScript;
|
269
|
+
static buildPayToPublicKeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
270
|
+
static buildPayToScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
271
|
+
static buildPayToWitnessPubkeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
272
|
+
static buildPayToWitnessScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
273
|
+
static lockScriptForAddress(address: string, coin: CoinType): BitcoinScript;
|
274
|
+
static hashTypeForCoin(coinType: CoinType): number;
|
275
|
+
static create(): BitcoinScript;
|
276
|
+
static createWithData(data: Uint8Array | Buffer): BitcoinScript;
|
277
|
+
static createCopy(script: BitcoinScript): BitcoinScript;
|
278
|
+
size(): number;
|
279
|
+
data(): Uint8Array;
|
280
|
+
scriptHash(): Uint8Array;
|
281
|
+
isPayToScriptHash(): boolean;
|
282
|
+
isPayToWitnessScriptHash(): boolean;
|
283
|
+
isPayToWitnessPublicKeyHash(): boolean;
|
284
|
+
isWitnessProgram(): boolean;
|
285
|
+
matchPayToPubkey(): Uint8Array;
|
286
|
+
matchPayToPubkeyHash(): Uint8Array;
|
287
|
+
matchPayToScriptHash(): Uint8Array;
|
288
|
+
matchPayToWitnessPublicKeyHash(): Uint8Array;
|
289
|
+
matchPayToWitnessScriptHash(): Uint8Array;
|
290
|
+
encode(): Uint8Array;
|
291
|
+
delete(): void;
|
292
|
+
}
|
293
|
+
export class Purpose {
|
302
294
|
value: number;
|
303
|
-
static
|
304
|
-
static
|
305
|
-
static
|
306
|
-
static
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
static
|
295
|
+
static bip44: Purpose;
|
296
|
+
static bip49: Purpose;
|
297
|
+
static bip84: Purpose;
|
298
|
+
static bip1852: Purpose;
|
299
|
+
}
|
300
|
+
export class StellarPassphrase {
|
301
|
+
value: number;
|
302
|
+
static stellar: StellarPassphrase;
|
303
|
+
static kin: StellarPassphrase;
|
311
304
|
}
|
305
|
+
|
306
|
+
declare function describeStellarPassphrase(value: StellarPassphrase): string;
|
307
|
+
|
312
308
|
export class Hash {
|
313
309
|
static sha1(data: Uint8Array | Buffer): Uint8Array;
|
314
310
|
static sha256(data: Uint8Array | Buffer): Uint8Array;
|
@@ -329,113 +325,38 @@ export class Hash {
|
|
329
325
|
static blake256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
330
326
|
static groestl512Groestl512(data: Uint8Array | Buffer): Uint8Array;
|
331
327
|
}
|
332
|
-
export class
|
333
|
-
static
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
static
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
static
|
356
|
-
static
|
357
|
-
static
|
358
|
-
static
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
static dogecoin: CoinType;
|
365
|
-
static eos: CoinType;
|
366
|
-
static ethereum: CoinType;
|
367
|
-
static ethereumClassic: CoinType;
|
368
|
-
static fio: CoinType;
|
369
|
-
static goChain: CoinType;
|
370
|
-
static groestlcoin: CoinType;
|
371
|
-
static icon: CoinType;
|
372
|
-
static ioTeX: CoinType;
|
373
|
-
static kava: CoinType;
|
374
|
-
static kin: CoinType;
|
375
|
-
static litecoin: CoinType;
|
376
|
-
static monacoin: CoinType;
|
377
|
-
static nebulas: CoinType;
|
378
|
-
static nuls: CoinType;
|
379
|
-
static nano: CoinType;
|
380
|
-
static near: CoinType;
|
381
|
-
static nimiq: CoinType;
|
382
|
-
static ontology: CoinType;
|
383
|
-
static poanetwork: CoinType;
|
384
|
-
static qtum: CoinType;
|
385
|
-
static xrp: CoinType;
|
386
|
-
static solana: CoinType;
|
387
|
-
static stellar: CoinType;
|
388
|
-
static tezos: CoinType;
|
389
|
-
static theta: CoinType;
|
390
|
-
static thunderToken: CoinType;
|
391
|
-
static neo: CoinType;
|
392
|
-
static tomoChain: CoinType;
|
393
|
-
static tron: CoinType;
|
394
|
-
static veChain: CoinType;
|
395
|
-
static viacoin: CoinType;
|
396
|
-
static wanchain: CoinType;
|
397
|
-
static zcash: CoinType;
|
398
|
-
static firo: CoinType;
|
399
|
-
static zilliqa: CoinType;
|
400
|
-
static zelcash: CoinType;
|
401
|
-
static ravencoin: CoinType;
|
402
|
-
static waves: CoinType;
|
403
|
-
static terra: CoinType;
|
404
|
-
static harmony: CoinType;
|
405
|
-
static algorand: CoinType;
|
406
|
-
static kusama: CoinType;
|
407
|
-
static polkadot: CoinType;
|
408
|
-
static filecoin: CoinType;
|
409
|
-
static elrond: CoinType;
|
410
|
-
static bandChain: CoinType;
|
411
|
-
static smartChainLegacy: CoinType;
|
412
|
-
static smartChain: CoinType;
|
413
|
-
static oasis: CoinType;
|
414
|
-
static polygon: CoinType;
|
415
|
-
static thorchain: CoinType;
|
416
|
-
static bluzelle: CoinType;
|
417
|
-
static optimism: CoinType;
|
418
|
-
static arbitrum: CoinType;
|
419
|
-
static ecochain: CoinType;
|
420
|
-
static avalancheCChain: CoinType;
|
421
|
-
static xdai: CoinType;
|
422
|
-
static fantom: CoinType;
|
423
|
-
static cryptoOrg: CoinType;
|
424
|
-
static celo: CoinType;
|
425
|
-
static ronin: CoinType;
|
426
|
-
static osmosis: CoinType;
|
427
|
-
static ecash: CoinType;
|
428
|
-
static cronosChain: CoinType;
|
429
|
-
static smartBitcoinCash: CoinType;
|
430
|
-
static kuCoinCommunityChain: CoinType;
|
431
|
-
static boba: CoinType;
|
432
|
-
static metis: CoinType;
|
433
|
-
static aurora: CoinType;
|
434
|
-
static evmos: CoinType;
|
435
|
-
static nativeEvmos: CoinType;
|
436
|
-
static moonriver: CoinType;
|
437
|
-
static moonbeam: CoinType;
|
438
|
-
static klaytn: CoinType;
|
328
|
+
export class HDWallet {
|
329
|
+
static getPublicKeyFromExtended(extended: string, coin: CoinType, derivationPath: string): PublicKey;
|
330
|
+
static create(strength: number, passphrase: string): HDWallet;
|
331
|
+
static createWithMnemonic(mnemonic: string, passphrase: string): HDWallet;
|
332
|
+
static createWithMnemonicCheck(mnemonic: string, passphrase: string, check: boolean): HDWallet;
|
333
|
+
static createWithEntropy(entropy: Uint8Array | Buffer, passphrase: string): HDWallet;
|
334
|
+
seed(): Uint8Array;
|
335
|
+
mnemonic(): string;
|
336
|
+
entropy(): Uint8Array;
|
337
|
+
getMasterKey(curve: Curve): PrivateKey;
|
338
|
+
getKeyForCoin(coin: CoinType): PrivateKey;
|
339
|
+
getAddressForCoin(coin: CoinType): string;
|
340
|
+
getKey(coin: CoinType, derivationPath: string): PrivateKey;
|
341
|
+
getDerivedKey(coin: CoinType, account: number, change: number, address: number): PrivateKey;
|
342
|
+
getExtendedPrivateKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
343
|
+
getExtendedPublicKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
344
|
+
getExtendedPrivateKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
345
|
+
getExtendedPublicKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
346
|
+
getExtendedPrivateKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
347
|
+
getExtendedPublicKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
348
|
+
delete(): void;
|
349
|
+
}
|
350
|
+
export class SegwitAddress {
|
351
|
+
static equal(lhs: SegwitAddress, rhs: SegwitAddress): boolean;
|
352
|
+
static isValidString(string: string): boolean;
|
353
|
+
static createWithString(string: string): SegwitAddress;
|
354
|
+
static createWithPublicKey(hrp: HRP, publicKey: PublicKey): SegwitAddress;
|
355
|
+
description(): string;
|
356
|
+
hrp(): HRP;
|
357
|
+
witnessVersion(): number;
|
358
|
+
witnessProgram(): Uint8Array;
|
359
|
+
delete(): void;
|
439
360
|
}
|
440
361
|
export class StoredKeyEncryptionLevel {
|
441
362
|
value: number;
|
@@ -444,6 +365,20 @@ export class StoredKeyEncryptionLevel {
|
|
444
365
|
static weak: StoredKeyEncryptionLevel;
|
445
366
|
static standard: StoredKeyEncryptionLevel;
|
446
367
|
}
|
368
|
+
export class Mnemonic {
|
369
|
+
static isValid(mnemonic: string): boolean;
|
370
|
+
static isValidWord(word: string): boolean;
|
371
|
+
static suggest(prefix: string): string;
|
372
|
+
}
|
373
|
+
export class THORChainSwap {
|
374
|
+
static buildSwap(input: Uint8Array | Buffer): Uint8Array;
|
375
|
+
}
|
376
|
+
export class AES {
|
377
|
+
static encryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
378
|
+
static decryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
379
|
+
static encryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
380
|
+
static decryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
381
|
+
}
|
447
382
|
export class EthereumAbiFunction {
|
448
383
|
static createWithString(name: string): EthereumAbiFunction;
|
449
384
|
getType(): string;
|
@@ -490,6 +425,18 @@ export class EthereumAbiFunction {
|
|
490
425
|
addInArrayParamBytesFix(arrayIdx: number, size: number, val: Uint8Array | Buffer): number;
|
491
426
|
delete(): void;
|
492
427
|
}
|
428
|
+
export class Curve {
|
429
|
+
value: number;
|
430
|
+
static secp256k1: Curve;
|
431
|
+
static ed25519: Curve;
|
432
|
+
static ed25519Blake2bNano: Curve;
|
433
|
+
static curve25519: Curve;
|
434
|
+
static nist256p1: Curve;
|
435
|
+
static ed25519Extended: Curve;
|
436
|
+
}
|
437
|
+
|
438
|
+
declare function describeCurve(value: Curve): string;
|
439
|
+
|
493
440
|
export class CoinTypeConfiguration {
|
494
441
|
static getSymbol(type: CoinType): string;
|
495
442
|
static getDecimals(type: CoinType): number;
|
@@ -498,6 +445,16 @@ export class CoinTypeConfiguration {
|
|
498
445
|
static getID(type: CoinType): string;
|
499
446
|
static getName(type: CoinType): string;
|
500
447
|
}
|
448
|
+
export class FIOAccount {
|
449
|
+
static createWithString(string: string): FIOAccount;
|
450
|
+
description(): string;
|
451
|
+
delete(): void;
|
452
|
+
}
|
453
|
+
export class NEARAccount {
|
454
|
+
static createWithString(string: string): NEARAccount;
|
455
|
+
description(): string;
|
456
|
+
delete(): void;
|
457
|
+
}
|
501
458
|
export class BitcoinAddress {
|
502
459
|
static equal(lhs: BitcoinAddress, rhs: BitcoinAddress): boolean;
|
503
460
|
static isValid(data: Uint8Array | Buffer): boolean;
|
@@ -510,33 +467,130 @@ export class BitcoinAddress {
|
|
510
467
|
keyhash(): Uint8Array;
|
511
468
|
delete(): void;
|
512
469
|
}
|
513
|
-
export class
|
514
|
-
static
|
515
|
-
static
|
516
|
-
static
|
517
|
-
static
|
518
|
-
description(): string;
|
519
|
-
hrp(): HRP;
|
520
|
-
witnessVersion(): number;
|
521
|
-
witnessProgram(): Uint8Array;
|
522
|
-
delete(): void;
|
470
|
+
export class Base58 {
|
471
|
+
static encode(data: Uint8Array | Buffer): string;
|
472
|
+
static encodeNoCheck(data: Uint8Array | Buffer): string;
|
473
|
+
static decode(string: string): Uint8Array;
|
474
|
+
static decodeNoCheck(string: string): Uint8Array;
|
523
475
|
}
|
524
|
-
export class
|
476
|
+
export class Derivation {
|
525
477
|
value: number;
|
526
|
-
static
|
527
|
-
static
|
528
|
-
static
|
529
|
-
static
|
530
|
-
static
|
478
|
+
static default: Derivation;
|
479
|
+
static custom: Derivation;
|
480
|
+
static bitcoinSegwit: Derivation;
|
481
|
+
static bitcoinLegacy: Derivation;
|
482
|
+
static litecoinLegacy: Derivation;
|
483
|
+
static solanaSolana: Derivation;
|
531
484
|
}
|
532
|
-
export class
|
533
|
-
|
534
|
-
static
|
535
|
-
static
|
485
|
+
export class PublicKeyType {
|
486
|
+
value: number;
|
487
|
+
static secp256k1: PublicKeyType;
|
488
|
+
static secp256k1Extended: PublicKeyType;
|
489
|
+
static nist256p1: PublicKeyType;
|
490
|
+
static nist256p1Extended: PublicKeyType;
|
491
|
+
static ed25519: PublicKeyType;
|
492
|
+
static ed25519Blake2b: PublicKeyType;
|
493
|
+
static curve25519: PublicKeyType;
|
494
|
+
static ed25519Extended: PublicKeyType;
|
536
495
|
}
|
537
|
-
export class
|
538
|
-
|
496
|
+
export class BitcoinSigHashType {
|
497
|
+
value: number;
|
498
|
+
static all: BitcoinSigHashType;
|
499
|
+
static none: BitcoinSigHashType;
|
500
|
+
static single: BitcoinSigHashType;
|
501
|
+
static fork: BitcoinSigHashType;
|
502
|
+
static forkBTG: BitcoinSigHashType;
|
503
|
+
}
|
504
|
+
export class EthereumChainID {
|
505
|
+
value: number;
|
506
|
+
static ethereum: EthereumChainID;
|
507
|
+
static classic: EthereumChainID;
|
508
|
+
static poa: EthereumChainID;
|
509
|
+
static vechain: EthereumChainID;
|
510
|
+
static callisto: EthereumChainID;
|
511
|
+
static tomochain: EthereumChainID;
|
512
|
+
static polygon: EthereumChainID;
|
513
|
+
static thundertoken: EthereumChainID;
|
514
|
+
static gochain: EthereumChainID;
|
515
|
+
static meter: EthereumChainID;
|
516
|
+
static celo: EthereumChainID;
|
517
|
+
static wanchain: EthereumChainID;
|
518
|
+
static cronos: EthereumChainID;
|
519
|
+
static optimism: EthereumChainID;
|
520
|
+
static xdai: EthereumChainID;
|
521
|
+
static smartbch: EthereumChainID;
|
522
|
+
static fantom: EthereumChainID;
|
523
|
+
static boba: EthereumChainID;
|
524
|
+
static kcc: EthereumChainID;
|
525
|
+
static heco: EthereumChainID;
|
526
|
+
static metis: EthereumChainID;
|
527
|
+
static moonbeam: EthereumChainID;
|
528
|
+
static moonriver: EthereumChainID;
|
529
|
+
static ronin: EthereumChainID;
|
530
|
+
static kavaevm: EthereumChainID;
|
531
|
+
static klaytn: EthereumChainID;
|
532
|
+
static avalanchec: EthereumChainID;
|
533
|
+
static evmos: EthereumChainID;
|
534
|
+
static arbitrum: EthereumChainID;
|
535
|
+
static smartchain: EthereumChainID;
|
536
|
+
static aurora: EthereumChainID;
|
537
|
+
}
|
538
|
+
export class HRP {
|
539
|
+
value: number;
|
540
|
+
static unknown: HRP;
|
541
|
+
static bitcoin: HRP;
|
542
|
+
static litecoin: HRP;
|
543
|
+
static viacoin: HRP;
|
544
|
+
static groestlcoin: HRP;
|
545
|
+
static digiByte: HRP;
|
546
|
+
static monacoin: HRP;
|
547
|
+
static cosmos: HRP;
|
548
|
+
static bitcoinCash: HRP;
|
549
|
+
static bitcoinGold: HRP;
|
550
|
+
static ioTeX: HRP;
|
551
|
+
static zilliqa: HRP;
|
552
|
+
static terra: HRP;
|
553
|
+
static cryptoOrg: HRP;
|
554
|
+
static kava: HRP;
|
555
|
+
static oasis: HRP;
|
556
|
+
static bluzelle: HRP;
|
557
|
+
static bandChain: HRP;
|
558
|
+
static elrond: HRP;
|
559
|
+
static binance: HRP;
|
560
|
+
static ecash: HRP;
|
561
|
+
static thorchain: HRP;
|
562
|
+
static harmony: HRP;
|
563
|
+
static cardano: HRP;
|
564
|
+
static qtum: HRP;
|
565
|
+
static osmosis: HRP;
|
566
|
+
static terraV2: HRP;
|
567
|
+
static nativeEvmos: HRP;
|
568
|
+
}
|
569
|
+
|
570
|
+
declare function describeHRP(value: HRP): string;
|
571
|
+
|
572
|
+
export class EthereumAbiValue {
|
573
|
+
static encodeBool(value: boolean): Uint8Array;
|
574
|
+
static encodeInt32(value: number): Uint8Array;
|
575
|
+
static encodeUInt32(value: number): Uint8Array;
|
576
|
+
static encodeInt256(value: Uint8Array | Buffer): Uint8Array;
|
577
|
+
static encodeUInt256(value: Uint8Array | Buffer): Uint8Array;
|
578
|
+
static encodeAddress(value: Uint8Array | Buffer): Uint8Array;
|
579
|
+
static encodeString(value: string): Uint8Array;
|
580
|
+
static encodeBytes(value: Uint8Array | Buffer): Uint8Array;
|
581
|
+
static encodeBytesDyn(value: Uint8Array | Buffer): Uint8Array;
|
582
|
+
static decodeUInt256(input: Uint8Array | Buffer): string;
|
583
|
+
static decodeValue(input: Uint8Array | Buffer, type: string): string;
|
584
|
+
static decodeArray(input: Uint8Array | Buffer, type: string): string;
|
585
|
+
}
|
586
|
+
export class AnyAddress {
|
587
|
+
static equal(lhs: AnyAddress, rhs: AnyAddress): boolean;
|
588
|
+
static isValid(string: string, coin: CoinType): boolean;
|
589
|
+
static createWithString(string: string, coin: CoinType): AnyAddress;
|
590
|
+
static createWithPublicKey(publicKey: PublicKey, coin: CoinType): AnyAddress;
|
539
591
|
description(): string;
|
592
|
+
coin(): CoinType;
|
593
|
+
data(): Uint8Array;
|
540
594
|
delete(): void;
|
541
595
|
}
|
542
596
|
export class StoredKey {
|
@@ -568,6 +622,19 @@ export class StoredKey {
|
|
568
622
|
fixAddresses(password: Uint8Array | Buffer): boolean;
|
569
623
|
delete(): void;
|
570
624
|
}
|
625
|
+
export class RippleXAddress {
|
626
|
+
static equal(lhs: RippleXAddress, rhs: RippleXAddress): boolean;
|
627
|
+
static isValidString(string: string): boolean;
|
628
|
+
static createWithString(string: string): RippleXAddress;
|
629
|
+
static createWithPublicKey(publicKey: PublicKey, tag: number): RippleXAddress;
|
630
|
+
description(): string;
|
631
|
+
tag(): number;
|
632
|
+
delete(): void;
|
633
|
+
}
|
634
|
+
export class PBKDF2 {
|
635
|
+
static hmacSha256(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
636
|
+
static hmacSha512(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
637
|
+
}
|
571
638
|
export class PublicKey {
|
572
639
|
static isValid(data: Uint8Array | Buffer, type: PublicKeyType): boolean;
|
573
640
|
static recover(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): PublicKey;
|
@@ -583,56 +650,3 @@ export class PublicKey {
|
|
583
650
|
verifySchnorr(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
584
651
|
delete(): void;
|
585
652
|
}
|
586
|
-
export class EthereumChainID {
|
587
|
-
value: number;
|
588
|
-
static ethereum: EthereumChainID;
|
589
|
-
static classic: EthereumChainID;
|
590
|
-
static poa: EthereumChainID;
|
591
|
-
static vechain: EthereumChainID;
|
592
|
-
static callisto: EthereumChainID;
|
593
|
-
static tomochain: EthereumChainID;
|
594
|
-
static polygon: EthereumChainID;
|
595
|
-
static thundertoken: EthereumChainID;
|
596
|
-
static gochain: EthereumChainID;
|
597
|
-
static celo: EthereumChainID;
|
598
|
-
static wanchain: EthereumChainID;
|
599
|
-
static cronos: EthereumChainID;
|
600
|
-
static optimism: EthereumChainID;
|
601
|
-
static xdai: EthereumChainID;
|
602
|
-
static smartbch: EthereumChainID;
|
603
|
-
static fantom: EthereumChainID;
|
604
|
-
static boba: EthereumChainID;
|
605
|
-
static kcc: EthereumChainID;
|
606
|
-
static heco: EthereumChainID;
|
607
|
-
static metis: EthereumChainID;
|
608
|
-
static moonbeam: EthereumChainID;
|
609
|
-
static moonriver: EthereumChainID;
|
610
|
-
static ronin: EthereumChainID;
|
611
|
-
static klaytn: EthereumChainID;
|
612
|
-
static avalanchec: EthereumChainID;
|
613
|
-
static evmos: EthereumChainID;
|
614
|
-
static arbitrum: EthereumChainID;
|
615
|
-
static smartchain: EthereumChainID;
|
616
|
-
static aurora: EthereumChainID;
|
617
|
-
}
|
618
|
-
export class BitcoinSigHashType {
|
619
|
-
value: number;
|
620
|
-
static all: BitcoinSigHashType;
|
621
|
-
static none: BitcoinSigHashType;
|
622
|
-
static single: BitcoinSigHashType;
|
623
|
-
static fork: BitcoinSigHashType;
|
624
|
-
static forkBTG: BitcoinSigHashType;
|
625
|
-
}
|
626
|
-
export class Base58 {
|
627
|
-
static encode(data: Uint8Array | Buffer): string;
|
628
|
-
static encodeNoCheck(data: Uint8Array | Buffer): string;
|
629
|
-
static decode(string: string): Uint8Array;
|
630
|
-
static decodeNoCheck(string: string): Uint8Array;
|
631
|
-
}
|
632
|
-
export class Purpose {
|
633
|
-
value: number;
|
634
|
-
static bip44: Purpose;
|
635
|
-
static bip49: Purpose;
|
636
|
-
static bip84: Purpose;
|
637
|
-
static bip1852: Purpose;
|
638
|
-
}
|