@trustwallet/wallet-core 2.9.5 → 2.9.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/index.d.ts +2 -3
- package/dist/index.js +16 -7
- package/dist/lib/wallet-core.d.ts +392 -390
- package/dist/lib/wallet-core.js +66 -66
- package/dist/lib/wallet-core.wasm +0 -0
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
export { TW, WalletCore };
|
1
|
+
export { TW } from "./generated/core_proto";
|
2
|
+
export * as WalletCore from "./lib/wallet-core";
|
package/dist/index.js
CHANGED
@@ -1,12 +1,21 @@
|
|
1
|
-
"use strict";
|
2
1
|
// Copyright © 2017-2022 Trust Wallet.
|
3
2
|
//
|
4
3
|
// This file is part of Trust. The full Trust copyright notice, including
|
5
4
|
// terms governing use, modification, and redistribution, is contained in the
|
6
5
|
// file LICENSE at the root of the source code distribution tree.
|
7
|
-
|
8
|
-
|
9
|
-
var
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
(function (factory) {
|
7
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
8
|
+
var v = factory(require, exports);
|
9
|
+
if (v !== undefined) module.exports = v;
|
10
|
+
}
|
11
|
+
else if (typeof define === "function" && define.amd) {
|
12
|
+
define(["require", "exports", "./generated/core_proto", "./lib/wallet-core"], factory);
|
13
|
+
}
|
14
|
+
})(function (require, exports) {
|
15
|
+
"use strict";
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
+
exports.WalletCore = exports.TW = void 0;
|
18
|
+
var core_proto_1 = require("./generated/core_proto");
|
19
|
+
Object.defineProperty(exports, "TW", { enumerable: true, get: function () { return core_proto_1.TW; } });
|
20
|
+
exports.WalletCore = require("./lib/wallet-core");
|
21
|
+
});
|
@@ -15,220 +15,25 @@ 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
|
20
|
-
static
|
21
|
-
static
|
22
|
-
static
|
23
|
-
static
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
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 {
|
90
|
-
value: number;
|
91
|
-
static default: Derivation;
|
92
|
-
static custom: Derivation;
|
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;
|
107
|
-
}
|
108
|
-
export class Account {
|
109
|
-
static create(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): Account;
|
110
|
-
address(): string;
|
111
|
-
derivation(): Derivation;
|
112
|
-
derivationPath(): string;
|
113
|
-
publicKey(): string;
|
114
|
-
extendedPublicKey(): string;
|
115
|
-
coin(): CoinType;
|
116
|
-
delete(): void;
|
117
|
-
}
|
118
|
-
export class DataVector {
|
119
|
-
static create(): DataVector;
|
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;
|
140
|
-
static isValidString(string: string): boolean;
|
141
|
-
static createWithString(string: string): RippleXAddress;
|
142
|
-
static createWithPublicKey(publicKey: PublicKey, tag: number): RippleXAddress;
|
143
|
-
description(): string;
|
144
|
-
tag(): number;
|
145
|
-
delete(): void;
|
146
|
-
}
|
147
|
-
export class EthereumAbiValue {
|
148
|
-
static encodeBool(value: boolean): Uint8Array;
|
149
|
-
static encodeInt32(value: number): Uint8Array;
|
150
|
-
static encodeUInt32(value: number): Uint8Array;
|
151
|
-
static encodeInt256(value: Uint8Array | Buffer): Uint8Array;
|
152
|
-
static encodeUInt256(value: Uint8Array | Buffer): Uint8Array;
|
153
|
-
static encodeAddress(value: Uint8Array | Buffer): Uint8Array;
|
154
|
-
static encodeString(value: string): Uint8Array;
|
155
|
-
static encodeBytes(value: Uint8Array | Buffer): Uint8Array;
|
156
|
-
static encodeBytesDyn(value: Uint8Array | Buffer): Uint8Array;
|
157
|
-
static decodeUInt256(input: Uint8Array | Buffer): string;
|
158
|
-
static decodeValue(input: Uint8Array | Buffer, type: string): string;
|
159
|
-
static decodeArray(input: Uint8Array | Buffer, type: string): string;
|
160
|
-
}
|
161
|
-
export class TransactionCompiler {
|
162
|
-
static buildInput(coinType: CoinType, from: string, to: string, amount: string, asset: string, memo: string, chainId: string): Uint8Array;
|
163
|
-
static preImageHashes(coinType: CoinType, txInputData: Uint8Array | Buffer): Uint8Array;
|
164
|
-
static compileWithSignatures(coinType: CoinType, txInputData: Uint8Array | Buffer, signatures: DataVector, publicKeys: DataVector): Uint8Array;
|
165
|
-
}
|
166
|
-
export class AESPaddingMode {
|
167
|
-
value: number;
|
168
|
-
static zero: AESPaddingMode;
|
169
|
-
static pkcs7: AESPaddingMode;
|
170
|
-
}
|
171
|
-
export class EthereumAbi {
|
172
|
-
static encode(fn: EthereumAbiFunction): Uint8Array;
|
173
|
-
static decodeOutput(fn: EthereumAbiFunction, encoded: Uint8Array | Buffer): boolean;
|
174
|
-
static decodeCall(data: Uint8Array | Buffer, abi: string): string;
|
175
|
-
static encodeTyped(messageJson: string): Uint8Array;
|
176
|
-
}
|
177
|
-
export class PBKDF2 {
|
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 {
|
226
|
-
value: number;
|
227
|
-
static polkadot: SS58AddressType;
|
228
|
-
static kusama: SS58AddressType;
|
229
|
-
}
|
230
|
-
export class THORChainSwap {
|
231
|
-
static buildSwap(input: Uint8Array | Buffer): Uint8Array;
|
18
|
+
export class Hash {
|
19
|
+
static sha1(data: Uint8Array | Buffer): Uint8Array;
|
20
|
+
static sha256(data: Uint8Array | Buffer): Uint8Array;
|
21
|
+
static sha512(data: Uint8Array | Buffer): Uint8Array;
|
22
|
+
static sha512_256(data: Uint8Array | Buffer): Uint8Array;
|
23
|
+
static keccak256(data: Uint8Array | Buffer): Uint8Array;
|
24
|
+
static keccak512(data: Uint8Array | Buffer): Uint8Array;
|
25
|
+
static sha3_256(data: Uint8Array | Buffer): Uint8Array;
|
26
|
+
static sha3_512(data: Uint8Array | Buffer): Uint8Array;
|
27
|
+
static ripemd(data: Uint8Array | Buffer): Uint8Array;
|
28
|
+
static blake256(data: Uint8Array | Buffer): Uint8Array;
|
29
|
+
static blake2b(data: Uint8Array | Buffer, size: number): Uint8Array;
|
30
|
+
static groestl512(data: Uint8Array | Buffer): Uint8Array;
|
31
|
+
static sha256SHA256(data: Uint8Array | Buffer): Uint8Array;
|
32
|
+
static sha256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
33
|
+
static sha3_256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
34
|
+
static blake256Blake256(data: Uint8Array | Buffer): Uint8Array;
|
35
|
+
static blake256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
36
|
+
static groestl512Groestl512(data: Uint8Array | Buffer): Uint8Array;
|
232
37
|
}
|
233
38
|
export class Blockchain {
|
234
39
|
value: number;
|
@@ -272,31 +77,97 @@ export class Blockchain {
|
|
272
77
|
static ronin: Blockchain;
|
273
78
|
static kusama: Blockchain;
|
274
79
|
}
|
275
|
-
export class
|
276
|
-
|
277
|
-
static
|
278
|
-
static
|
279
|
-
static
|
280
|
-
|
80
|
+
export class BitcoinSigHashType {
|
81
|
+
value: number;
|
82
|
+
static all: BitcoinSigHashType;
|
83
|
+
static none: BitcoinSigHashType;
|
84
|
+
static single: BitcoinSigHashType;
|
85
|
+
static fork: BitcoinSigHashType;
|
86
|
+
static forkBTG: BitcoinSigHashType;
|
87
|
+
}
|
88
|
+
export class AnyAddress {
|
89
|
+
static equal(lhs: AnyAddress, rhs: AnyAddress): boolean;
|
90
|
+
static isValid(string: string, coin: CoinType): boolean;
|
91
|
+
static createWithString(string: string, coin: CoinType): AnyAddress;
|
92
|
+
static createWithPublicKey(publicKey: PublicKey, coin: CoinType): AnyAddress;
|
93
|
+
description(): string;
|
94
|
+
coin(): CoinType;
|
95
|
+
data(): Uint8Array;
|
96
|
+
delete(): void;
|
97
|
+
}
|
98
|
+
export class FIOAccount {
|
99
|
+
static createWithString(string: string): FIOAccount;
|
100
|
+
description(): string;
|
101
|
+
delete(): void;
|
102
|
+
}
|
103
|
+
export class Mnemonic {
|
104
|
+
static isValid(mnemonic: string): boolean;
|
105
|
+
static isValidWord(word: string): boolean;
|
106
|
+
static suggest(prefix: string): string;
|
107
|
+
}
|
108
|
+
export class StoredKeyEncryptionLevel {
|
109
|
+
value: number;
|
110
|
+
static default: StoredKeyEncryptionLevel;
|
111
|
+
static minimal: StoredKeyEncryptionLevel;
|
112
|
+
static weak: StoredKeyEncryptionLevel;
|
113
|
+
static standard: StoredKeyEncryptionLevel;
|
114
|
+
}
|
115
|
+
export class SS58AddressType {
|
116
|
+
value: number;
|
117
|
+
static polkadot: SS58AddressType;
|
118
|
+
static kusama: SS58AddressType;
|
119
|
+
}
|
120
|
+
export class Cardano {
|
121
|
+
static minAdaAmount(tokenBundle: Uint8Array | Buffer): number;
|
122
|
+
}
|
123
|
+
export class EthereumAbiFunction {
|
124
|
+
static createWithString(name: string): EthereumAbiFunction;
|
125
|
+
getType(): string;
|
126
|
+
addParamUInt8(val: number, isOutput: boolean): number;
|
127
|
+
addParamUInt16(val: number, isOutput: boolean): number;
|
128
|
+
addParamUInt32(val: number, isOutput: boolean): number;
|
129
|
+
addParamUInt64(val: number, isOutput: boolean): number;
|
130
|
+
addParamUInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
|
131
|
+
addParamUIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
132
|
+
addParamInt8(val: number, isOutput: boolean): number;
|
133
|
+
addParamInt16(val: number, isOutput: boolean): number;
|
134
|
+
addParamInt32(val: number, isOutput: boolean): number;
|
135
|
+
addParamInt64(val: number, isOutput: boolean): number;
|
136
|
+
addParamInt256(val: Uint8Array | Buffer, isOutput: boolean): number;
|
137
|
+
addParamIntN(bits: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
138
|
+
addParamBool(val: boolean, isOutput: boolean): number;
|
139
|
+
addParamString(val: string, isOutput: boolean): number;
|
140
|
+
addParamAddress(val: Uint8Array | Buffer, isOutput: boolean): number;
|
141
|
+
addParamBytes(val: Uint8Array | Buffer, isOutput: boolean): number;
|
142
|
+
addParamBytesFix(size: number, val: Uint8Array | Buffer, isOutput: boolean): number;
|
143
|
+
addParamArray(isOutput: boolean): number;
|
144
|
+
getParamUInt8(idx: number, isOutput: boolean): number;
|
145
|
+
getParamUInt64(idx: number, isOutput: boolean): number;
|
146
|
+
getParamUInt256(idx: number, isOutput: boolean): Uint8Array;
|
147
|
+
getParamBool(idx: number, isOutput: boolean): boolean;
|
148
|
+
getParamString(idx: number, isOutput: boolean): string;
|
149
|
+
getParamAddress(idx: number, isOutput: boolean): Uint8Array;
|
150
|
+
addInArrayParamUInt8(arrayIdx: number, val: number): number;
|
151
|
+
addInArrayParamUInt16(arrayIdx: number, val: number): number;
|
152
|
+
addInArrayParamUInt32(arrayIdx: number, val: number): number;
|
153
|
+
addInArrayParamUInt64(arrayIdx: number, val: number): number;
|
154
|
+
addInArrayParamUInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
155
|
+
addInArrayParamUIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
156
|
+
addInArrayParamInt8(arrayIdx: number, val: number): number;
|
157
|
+
addInArrayParamInt16(arrayIdx: number, val: number): number;
|
158
|
+
addInArrayParamInt32(arrayIdx: number, val: number): number;
|
159
|
+
addInArrayParamInt64(arrayIdx: number, val: number): number;
|
160
|
+
addInArrayParamInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
161
|
+
addInArrayParamIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
162
|
+
addInArrayParamBool(arrayIdx: number, val: boolean): number;
|
163
|
+
addInArrayParamString(arrayIdx: number, val: string): number;
|
164
|
+
addInArrayParamAddress(arrayIdx: number, val: Uint8Array | Buffer): number;
|
165
|
+
addInArrayParamBytes(arrayIdx: number, val: Uint8Array | Buffer): number;
|
166
|
+
addInArrayParamBytesFix(arrayIdx: number, size: number, val: Uint8Array | Buffer): number;
|
281
167
|
delete(): void;
|
282
168
|
}
|
283
|
-
export class
|
284
|
-
|
285
|
-
static none: HDVersion;
|
286
|
-
static xpub: HDVersion;
|
287
|
-
static xprv: HDVersion;
|
288
|
-
static ypub: HDVersion;
|
289
|
-
static yprv: HDVersion;
|
290
|
-
static zpub: HDVersion;
|
291
|
-
static zprv: HDVersion;
|
292
|
-
static ltub: HDVersion;
|
293
|
-
static ltpv: HDVersion;
|
294
|
-
static mtub: HDVersion;
|
295
|
-
static mtpv: HDVersion;
|
296
|
-
static dpub: HDVersion;
|
297
|
-
static dprv: HDVersion;
|
298
|
-
static dgub: HDVersion;
|
299
|
-
static dgpv: HDVersion;
|
169
|
+
export class THORChainSwap {
|
170
|
+
static buildSwap(input: Uint8Array | Buffer): Uint8Array;
|
300
171
|
}
|
301
172
|
export class PublicKeyType {
|
302
173
|
value: number;
|
@@ -309,44 +180,6 @@ export class PublicKeyType {
|
|
309
180
|
static curve25519: PublicKeyType;
|
310
181
|
static ed25519Extended: PublicKeyType;
|
311
182
|
}
|
312
|
-
export class Hash {
|
313
|
-
static sha1(data: Uint8Array | Buffer): Uint8Array;
|
314
|
-
static sha256(data: Uint8Array | Buffer): Uint8Array;
|
315
|
-
static sha512(data: Uint8Array | Buffer): Uint8Array;
|
316
|
-
static sha512_256(data: Uint8Array | Buffer): Uint8Array;
|
317
|
-
static keccak256(data: Uint8Array | Buffer): Uint8Array;
|
318
|
-
static keccak512(data: Uint8Array | Buffer): Uint8Array;
|
319
|
-
static sha3_256(data: Uint8Array | Buffer): Uint8Array;
|
320
|
-
static sha3_512(data: Uint8Array | Buffer): Uint8Array;
|
321
|
-
static ripemd(data: Uint8Array | Buffer): Uint8Array;
|
322
|
-
static blake256(data: Uint8Array | Buffer): Uint8Array;
|
323
|
-
static blake2b(data: Uint8Array | Buffer, size: number): Uint8Array;
|
324
|
-
static groestl512(data: Uint8Array | Buffer): Uint8Array;
|
325
|
-
static sha256SHA256(data: Uint8Array | Buffer): Uint8Array;
|
326
|
-
static sha256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
327
|
-
static sha3_256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
328
|
-
static blake256Blake256(data: Uint8Array | Buffer): Uint8Array;
|
329
|
-
static blake256RIPEMD(data: Uint8Array | Buffer): Uint8Array;
|
330
|
-
static groestl512Groestl512(data: Uint8Array | Buffer): Uint8Array;
|
331
|
-
}
|
332
|
-
export class Cardano {
|
333
|
-
static minAdaAmount(tokenBundle: Uint8Array | Buffer): number;
|
334
|
-
}
|
335
|
-
export class StellarVersionByte {
|
336
|
-
value: number;
|
337
|
-
static accountID: StellarVersionByte;
|
338
|
-
static seed: StellarVersionByte;
|
339
|
-
static preAuthTX: StellarVersionByte;
|
340
|
-
static sha256Hash: StellarVersionByte;
|
341
|
-
}
|
342
|
-
export class StellarPassphrase {
|
343
|
-
value: number;
|
344
|
-
static stellar: StellarPassphrase;
|
345
|
-
static kin: StellarPassphrase;
|
346
|
-
}
|
347
|
-
|
348
|
-
declare function describeStellarPassphrase(value: StellarPassphrase): string;
|
349
|
-
|
350
183
|
export class CoinType {
|
351
184
|
value: number;
|
352
185
|
static aeternity: CoinType;
|
@@ -437,59 +270,64 @@ export class CoinType {
|
|
437
270
|
static moonbeam: CoinType;
|
438
271
|
static klaytn: CoinType;
|
439
272
|
}
|
440
|
-
export class
|
273
|
+
export class HDVersion {
|
441
274
|
value: number;
|
442
|
-
static
|
443
|
-
static
|
444
|
-
static
|
445
|
-
static
|
275
|
+
static none: HDVersion;
|
276
|
+
static xpub: HDVersion;
|
277
|
+
static xprv: HDVersion;
|
278
|
+
static ypub: HDVersion;
|
279
|
+
static yprv: HDVersion;
|
280
|
+
static zpub: HDVersion;
|
281
|
+
static zprv: HDVersion;
|
282
|
+
static ltub: HDVersion;
|
283
|
+
static ltpv: HDVersion;
|
284
|
+
static mtub: HDVersion;
|
285
|
+
static mtpv: HDVersion;
|
286
|
+
static dpub: HDVersion;
|
287
|
+
static dprv: HDVersion;
|
288
|
+
static dgub: HDVersion;
|
289
|
+
static dgpv: HDVersion;
|
446
290
|
}
|
447
|
-
export class
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
addInArrayParamUInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
479
|
-
addInArrayParamUIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
480
|
-
addInArrayParamInt8(arrayIdx: number, val: number): number;
|
481
|
-
addInArrayParamInt16(arrayIdx: number, val: number): number;
|
482
|
-
addInArrayParamInt32(arrayIdx: number, val: number): number;
|
483
|
-
addInArrayParamInt64(arrayIdx: number, val: number): number;
|
484
|
-
addInArrayParamInt256(arrayIdx: number, val: Uint8Array | Buffer): number;
|
485
|
-
addInArrayParamIntN(arrayIdx: number, bits: number, val: Uint8Array | Buffer): number;
|
486
|
-
addInArrayParamBool(arrayIdx: number, val: boolean): number;
|
487
|
-
addInArrayParamString(arrayIdx: number, val: string): number;
|
488
|
-
addInArrayParamAddress(arrayIdx: number, val: Uint8Array | Buffer): number;
|
489
|
-
addInArrayParamBytes(arrayIdx: number, val: Uint8Array | Buffer): number;
|
490
|
-
addInArrayParamBytesFix(arrayIdx: number, size: number, val: Uint8Array | Buffer): number;
|
291
|
+
export class Purpose {
|
292
|
+
value: number;
|
293
|
+
static bip44: Purpose;
|
294
|
+
static bip49: Purpose;
|
295
|
+
static bip84: Purpose;
|
296
|
+
static bip1852: Purpose;
|
297
|
+
}
|
298
|
+
export class PBKDF2 {
|
299
|
+
static hmacSha256(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
300
|
+
static hmacSha512(password: Uint8Array | Buffer, salt: Uint8Array | Buffer, iterations: number, dkLen: number): Uint8Array;
|
301
|
+
}
|
302
|
+
export class Base58 {
|
303
|
+
static encode(data: Uint8Array | Buffer): string;
|
304
|
+
static encodeNoCheck(data: Uint8Array | Buffer): string;
|
305
|
+
static decode(string: string): Uint8Array;
|
306
|
+
static decodeNoCheck(string: string): Uint8Array;
|
307
|
+
}
|
308
|
+
export class TransactionCompiler {
|
309
|
+
static buildInput(coinType: CoinType, from: string, to: string, amount: string, asset: string, memo: string, chainId: string): Uint8Array;
|
310
|
+
static preImageHashes(coinType: CoinType, txInputData: Uint8Array | Buffer): Uint8Array;
|
311
|
+
static compileWithSignatures(coinType: CoinType, txInputData: Uint8Array | Buffer, signatures: DataVector, publicKeys: DataVector): Uint8Array;
|
312
|
+
}
|
313
|
+
export class SegwitAddress {
|
314
|
+
static equal(lhs: SegwitAddress, rhs: SegwitAddress): boolean;
|
315
|
+
static isValidString(string: string): boolean;
|
316
|
+
static createWithString(string: string): SegwitAddress;
|
317
|
+
static createWithPublicKey(hrp: HRP, publicKey: PublicKey): SegwitAddress;
|
318
|
+
description(): string;
|
319
|
+
hrp(): HRP;
|
320
|
+
witnessVersion(): number;
|
321
|
+
witnessProgram(): Uint8Array;
|
491
322
|
delete(): void;
|
492
323
|
}
|
324
|
+
export class StellarVersionByte {
|
325
|
+
value: number;
|
326
|
+
static accountID: StellarVersionByte;
|
327
|
+
static seed: StellarVersionByte;
|
328
|
+
static preAuthTX: StellarVersionByte;
|
329
|
+
static sha256Hash: StellarVersionByte;
|
330
|
+
}
|
493
331
|
export class CoinTypeConfiguration {
|
494
332
|
static getSymbol(type: CoinType): string;
|
495
333
|
static getDecimals(type: CoinType): number;
|
@@ -498,6 +336,11 @@ export class CoinTypeConfiguration {
|
|
498
336
|
static getID(type: CoinType): string;
|
499
337
|
static getName(type: CoinType): string;
|
500
338
|
}
|
339
|
+
export class NEARAccount {
|
340
|
+
static createWithString(string: string): NEARAccount;
|
341
|
+
description(): string;
|
342
|
+
delete(): void;
|
343
|
+
}
|
501
344
|
export class BitcoinAddress {
|
502
345
|
static equal(lhs: BitcoinAddress, rhs: BitcoinAddress): boolean;
|
503
346
|
static isValid(data: Uint8Array | Buffer): boolean;
|
@@ -510,17 +353,45 @@ export class BitcoinAddress {
|
|
510
353
|
keyhash(): Uint8Array;
|
511
354
|
delete(): void;
|
512
355
|
}
|
513
|
-
export class
|
514
|
-
static
|
515
|
-
static
|
516
|
-
static
|
517
|
-
static
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
356
|
+
export class EthereumAbi {
|
357
|
+
static encode(fn: EthereumAbiFunction): Uint8Array;
|
358
|
+
static decodeOutput(fn: EthereumAbiFunction, encoded: Uint8Array | Buffer): boolean;
|
359
|
+
static decodeCall(data: Uint8Array | Buffer, abi: string): string;
|
360
|
+
static encodeTyped(messageJson: string): Uint8Array;
|
361
|
+
}
|
362
|
+
export class HRP {
|
363
|
+
value: number;
|
364
|
+
static unknown: HRP;
|
365
|
+
static bitcoin: HRP;
|
366
|
+
static litecoin: HRP;
|
367
|
+
static viacoin: HRP;
|
368
|
+
static groestlcoin: HRP;
|
369
|
+
static digiByte: HRP;
|
370
|
+
static monacoin: HRP;
|
371
|
+
static cosmos: HRP;
|
372
|
+
static bitcoinCash: HRP;
|
373
|
+
static bitcoinGold: HRP;
|
374
|
+
static ioTeX: HRP;
|
375
|
+
static zilliqa: HRP;
|
376
|
+
static terra: HRP;
|
377
|
+
static cryptoOrg: HRP;
|
378
|
+
static kava: HRP;
|
379
|
+
static oasis: HRP;
|
380
|
+
static bluzelle: HRP;
|
381
|
+
static bandChain: HRP;
|
382
|
+
static elrond: HRP;
|
383
|
+
static binance: HRP;
|
384
|
+
static ecash: HRP;
|
385
|
+
static thorchain: HRP;
|
386
|
+
static harmony: HRP;
|
387
|
+
static cardano: HRP;
|
388
|
+
static qtum: HRP;
|
389
|
+
static osmosis: HRP;
|
390
|
+
static nativeEvmos: HRP;
|
523
391
|
}
|
392
|
+
|
393
|
+
declare function describeHRP(value: HRP): string;
|
394
|
+
|
524
395
|
export class StellarMemoType {
|
525
396
|
value: number;
|
526
397
|
static none: StellarMemoType;
|
@@ -529,14 +400,117 @@ export class StellarMemoType {
|
|
529
400
|
static hash: StellarMemoType;
|
530
401
|
static return: StellarMemoType;
|
531
402
|
}
|
532
|
-
export class
|
533
|
-
|
534
|
-
static
|
535
|
-
static
|
403
|
+
export class StellarPassphrase {
|
404
|
+
value: number;
|
405
|
+
static stellar: StellarPassphrase;
|
406
|
+
static kin: StellarPassphrase;
|
536
407
|
}
|
537
|
-
|
538
|
-
|
408
|
+
|
409
|
+
declare function describeStellarPassphrase(value: StellarPassphrase): string;
|
410
|
+
|
411
|
+
export class SolanaAddress {
|
412
|
+
static createWithString(string: string): SolanaAddress;
|
539
413
|
description(): string;
|
414
|
+
defaultTokenAddress(tokenMintAddress: string): string;
|
415
|
+
delete(): void;
|
416
|
+
}
|
417
|
+
export class EthereumChainID {
|
418
|
+
value: number;
|
419
|
+
static ethereum: EthereumChainID;
|
420
|
+
static classic: EthereumChainID;
|
421
|
+
static poa: EthereumChainID;
|
422
|
+
static vechain: EthereumChainID;
|
423
|
+
static callisto: EthereumChainID;
|
424
|
+
static tomochain: EthereumChainID;
|
425
|
+
static polygon: EthereumChainID;
|
426
|
+
static thundertoken: EthereumChainID;
|
427
|
+
static gochain: EthereumChainID;
|
428
|
+
static celo: EthereumChainID;
|
429
|
+
static wanchain: EthereumChainID;
|
430
|
+
static cronos: EthereumChainID;
|
431
|
+
static optimism: EthereumChainID;
|
432
|
+
static xdai: EthereumChainID;
|
433
|
+
static smartbch: EthereumChainID;
|
434
|
+
static fantom: EthereumChainID;
|
435
|
+
static boba: EthereumChainID;
|
436
|
+
static kcc: EthereumChainID;
|
437
|
+
static heco: EthereumChainID;
|
438
|
+
static metis: EthereumChainID;
|
439
|
+
static moonbeam: EthereumChainID;
|
440
|
+
static moonriver: EthereumChainID;
|
441
|
+
static ronin: EthereumChainID;
|
442
|
+
static klaytn: EthereumChainID;
|
443
|
+
static avalanchec: EthereumChainID;
|
444
|
+
static evmos: EthereumChainID;
|
445
|
+
static arbitrum: EthereumChainID;
|
446
|
+
static smartchain: EthereumChainID;
|
447
|
+
static aurora: EthereumChainID;
|
448
|
+
}
|
449
|
+
export class BitcoinScript {
|
450
|
+
static equal(lhs: BitcoinScript, rhs: BitcoinScript): boolean;
|
451
|
+
static buildPayToPublicKey(pubkey: Uint8Array | Buffer): BitcoinScript;
|
452
|
+
static buildPayToPublicKeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
453
|
+
static buildPayToScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
454
|
+
static buildPayToWitnessPubkeyHash(hash: Uint8Array | Buffer): BitcoinScript;
|
455
|
+
static buildPayToWitnessScriptHash(scriptHash: Uint8Array | Buffer): BitcoinScript;
|
456
|
+
static lockScriptForAddress(address: string, coin: CoinType): BitcoinScript;
|
457
|
+
static hashTypeForCoin(coinType: CoinType): number;
|
458
|
+
static create(): BitcoinScript;
|
459
|
+
static createWithData(data: Uint8Array | Buffer): BitcoinScript;
|
460
|
+
static createCopy(script: BitcoinScript): BitcoinScript;
|
461
|
+
size(): number;
|
462
|
+
data(): Uint8Array;
|
463
|
+
scriptHash(): Uint8Array;
|
464
|
+
isPayToScriptHash(): boolean;
|
465
|
+
isPayToWitnessScriptHash(): boolean;
|
466
|
+
isPayToWitnessPublicKeyHash(): boolean;
|
467
|
+
isWitnessProgram(): boolean;
|
468
|
+
matchPayToPubkey(): Uint8Array;
|
469
|
+
matchPayToPubkeyHash(): Uint8Array;
|
470
|
+
matchPayToScriptHash(): Uint8Array;
|
471
|
+
matchPayToWitnessPublicKeyHash(): Uint8Array;
|
472
|
+
matchPayToWitnessScriptHash(): Uint8Array;
|
473
|
+
encode(): Uint8Array;
|
474
|
+
delete(): void;
|
475
|
+
}
|
476
|
+
export class PrivateKey {
|
477
|
+
static isValid(data: Uint8Array | Buffer, curve: Curve): boolean;
|
478
|
+
static create(): PrivateKey;
|
479
|
+
static createWithData(data: Uint8Array | Buffer): PrivateKey;
|
480
|
+
static createCopy(key: PrivateKey): PrivateKey;
|
481
|
+
data(): Uint8Array;
|
482
|
+
getPublicKeySecp256k1(compressed: boolean): PublicKey;
|
483
|
+
getPublicKeyNist256p1(): PublicKey;
|
484
|
+
getPublicKeyEd25519(): PublicKey;
|
485
|
+
getPublicKeyEd25519Blake2b(): PublicKey;
|
486
|
+
getPublicKeyEd25519Extended(): PublicKey;
|
487
|
+
getPublicKeyCurve25519(): PublicKey;
|
488
|
+
getSharedKey(publicKey: PublicKey, curve: Curve): Uint8Array;
|
489
|
+
sign(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
490
|
+
signAsDER(digest: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
491
|
+
signSchnorr(message: Uint8Array | Buffer, curve: Curve): Uint8Array;
|
492
|
+
delete(): void;
|
493
|
+
}
|
494
|
+
export class HDWallet {
|
495
|
+
static getPublicKeyFromExtended(extended: string, coin: CoinType, derivationPath: string): PublicKey;
|
496
|
+
static create(strength: number, passphrase: string): HDWallet;
|
497
|
+
static createWithMnemonic(mnemonic: string, passphrase: string): HDWallet;
|
498
|
+
static createWithMnemonicCheck(mnemonic: string, passphrase: string, check: boolean): HDWallet;
|
499
|
+
static createWithEntropy(entropy: Uint8Array | Buffer, passphrase: string): HDWallet;
|
500
|
+
seed(): Uint8Array;
|
501
|
+
mnemonic(): string;
|
502
|
+
entropy(): Uint8Array;
|
503
|
+
getMasterKey(curve: Curve): PrivateKey;
|
504
|
+
getKeyForCoin(coin: CoinType): PrivateKey;
|
505
|
+
getAddressForCoin(coin: CoinType): string;
|
506
|
+
getKey(coin: CoinType, derivationPath: string): PrivateKey;
|
507
|
+
getDerivedKey(coin: CoinType, account: number, change: number, address: number): PrivateKey;
|
508
|
+
getExtendedPrivateKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
509
|
+
getExtendedPublicKey(purpose: Purpose, coin: CoinType, version: HDVersion): string;
|
510
|
+
getExtendedPrivateKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
511
|
+
getExtendedPublicKeyAccount(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion, account: number): string;
|
512
|
+
getExtendedPrivateKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
513
|
+
getExtendedPublicKeyDerivation(purpose: Purpose, coin: CoinType, derivation: Derivation, version: HDVersion): string;
|
540
514
|
delete(): void;
|
541
515
|
}
|
542
516
|
export class StoredKey {
|
@@ -568,6 +542,67 @@ export class StoredKey {
|
|
568
542
|
fixAddresses(password: Uint8Array | Buffer): boolean;
|
569
543
|
delete(): void;
|
570
544
|
}
|
545
|
+
export class RippleXAddress {
|
546
|
+
static equal(lhs: RippleXAddress, rhs: RippleXAddress): boolean;
|
547
|
+
static isValidString(string: string): boolean;
|
548
|
+
static createWithString(string: string): RippleXAddress;
|
549
|
+
static createWithPublicKey(publicKey: PublicKey, tag: number): RippleXAddress;
|
550
|
+
description(): string;
|
551
|
+
tag(): number;
|
552
|
+
delete(): void;
|
553
|
+
}
|
554
|
+
export class EthereumAbiValue {
|
555
|
+
static encodeBool(value: boolean): Uint8Array;
|
556
|
+
static encodeInt32(value: number): Uint8Array;
|
557
|
+
static encodeUInt32(value: number): Uint8Array;
|
558
|
+
static encodeInt256(value: Uint8Array | Buffer): Uint8Array;
|
559
|
+
static encodeUInt256(value: Uint8Array | Buffer): Uint8Array;
|
560
|
+
static encodeAddress(value: Uint8Array | Buffer): Uint8Array;
|
561
|
+
static encodeString(value: string): Uint8Array;
|
562
|
+
static encodeBytes(value: Uint8Array | Buffer): Uint8Array;
|
563
|
+
static encodeBytesDyn(value: Uint8Array | Buffer): Uint8Array;
|
564
|
+
static decodeUInt256(input: Uint8Array | Buffer): string;
|
565
|
+
static decodeValue(input: Uint8Array | Buffer, type: string): string;
|
566
|
+
static decodeArray(input: Uint8Array | Buffer, type: string): string;
|
567
|
+
}
|
568
|
+
export class AES {
|
569
|
+
static encryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
570
|
+
static decryptCBC(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer, mode: AESPaddingMode): Uint8Array;
|
571
|
+
static encryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
572
|
+
static decryptCTR(key: Uint8Array | Buffer, data: Uint8Array | Buffer, iv: Uint8Array | Buffer): Uint8Array;
|
573
|
+
}
|
574
|
+
export class AESPaddingMode {
|
575
|
+
value: number;
|
576
|
+
static zero: AESPaddingMode;
|
577
|
+
static pkcs7: AESPaddingMode;
|
578
|
+
}
|
579
|
+
export class GroestlcoinAddress {
|
580
|
+
static equal(lhs: GroestlcoinAddress, rhs: GroestlcoinAddress): boolean;
|
581
|
+
static isValidString(string: string): boolean;
|
582
|
+
static createWithString(string: string): GroestlcoinAddress;
|
583
|
+
static createWithPublicKey(publicKey: PublicKey, prefix: number): GroestlcoinAddress;
|
584
|
+
description(): string;
|
585
|
+
delete(): void;
|
586
|
+
}
|
587
|
+
export class Account {
|
588
|
+
static create(address: string, coin: CoinType, derivation: Derivation, derivationPath: string, publicKey: string, extendedPublicKey: string): Account;
|
589
|
+
address(): string;
|
590
|
+
derivation(): Derivation;
|
591
|
+
derivationPath(): string;
|
592
|
+
publicKey(): string;
|
593
|
+
extendedPublicKey(): string;
|
594
|
+
coin(): CoinType;
|
595
|
+
delete(): void;
|
596
|
+
}
|
597
|
+
export class Derivation {
|
598
|
+
value: number;
|
599
|
+
static default: Derivation;
|
600
|
+
static custom: Derivation;
|
601
|
+
static bitcoinSegwit: Derivation;
|
602
|
+
static bitcoinLegacy: Derivation;
|
603
|
+
static litecoinLegacy: Derivation;
|
604
|
+
static solanaSolana: Derivation;
|
605
|
+
}
|
571
606
|
export class PublicKey {
|
572
607
|
static isValid(data: Uint8Array | Buffer, type: PublicKeyType): boolean;
|
573
608
|
static recover(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): PublicKey;
|
@@ -583,56 +618,23 @@ export class PublicKey {
|
|
583
618
|
verifySchnorr(signature: Uint8Array | Buffer, message: Uint8Array | Buffer): boolean;
|
584
619
|
delete(): void;
|
585
620
|
}
|
586
|
-
export class
|
587
|
-
|
588
|
-
static
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
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;
|
621
|
+
export class DataVector {
|
622
|
+
static create(): DataVector;
|
623
|
+
static createWithData(data: Uint8Array | Buffer): DataVector;
|
624
|
+
size(): number;
|
625
|
+
add(data: Uint8Array | Buffer): void;
|
626
|
+
get(index: number): Uint8Array;
|
627
|
+
delete(): void;
|
631
628
|
}
|
632
|
-
export class
|
629
|
+
export class Curve {
|
633
630
|
value: number;
|
634
|
-
static
|
635
|
-
static
|
636
|
-
static
|
637
|
-
static
|
631
|
+
static secp256k1: Curve;
|
632
|
+
static ed25519: Curve;
|
633
|
+
static ed25519Blake2bNano: Curve;
|
634
|
+
static curve25519: Curve;
|
635
|
+
static nist256p1: Curve;
|
636
|
+
static ed25519Extended: Curve;
|
638
637
|
}
|
638
|
+
|
639
|
+
declare function describeCurve(value: Curve): string;
|
640
|
+
|
package/dist/lib/wallet-core.js
CHANGED
@@ -12,94 +12,94 @@ function Aa(a,b,c){void 0===c&&(c=2147483647);if(4>c)return 0;var d=b;c=d+c-4;fo
|
|
12
12
|
function Fa(){var a=oa.buffer;Ca=a;g.HEAP8=D=new Int8Array(a);g.HEAP16=B=new Int16Array(a);g.HEAP32=C=new Int32Array(a);g.HEAPU8=z=new Uint8Array(a);g.HEAPU16=wa=new Uint16Array(a);g.HEAPU32=F=new Uint32Array(a);g.HEAPF32=Da=new Float32Array(a);g.HEAPF64=Ea=new Float64Array(a)}var Ga,Ha=[],Ia=[],Ja=[];function Ka(){var a=g.preRun.shift();Ha.unshift(a)}var G=0,La=null,Ma=null;
|
13
13
|
function x(a){if(g.onAbort)g.onAbort(a);a="Aborted("+a+")";u(a);pa=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}function Na(){return H.startsWith("data:application/octet-stream;base64,")}var H;H="wallet-core.wasm";if(!Na()){var Oa=H;H=g.locateFile?g.locateFile(Oa,n):n+Oa}function Pa(){var a=H;try{if(a==H&&na)return new Uint8Array(na);if(ja)return ja(a);throw"both async and sync fetching of the wasm failed";}catch(b){x(b)}}
|
14
14
|
function Qa(){if(!na&&(ca||ea)){if("function"==typeof fetch&&!H.startsWith("file://"))return fetch(H,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+H+"'";return a.arrayBuffer()}).catch(function(){return Pa()});if(ia)return new Promise(function(a,b){ia(H,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Pa()})}var I,Ra;
|
15
|
-
function Sa(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(g);else{var c=b.
|
16
|
-
function Va(a){this.va=a-24;this.
|
15
|
+
function Sa(a){for(;0<a.length;){var b=a.shift();if("function"==typeof b)b(g);else{var c=b.Xb;"number"==typeof c?void 0===b.bb?Ta(c)():Ta(c)(b.bb):c(void 0===b.bb?null:b.bb)}}}var Ua=[];function Ta(a){var b=Ua[a];b||(a>=Ua.length&&(Ua.length=a+1),Ua[a]=b=Ga.get(a));return b}
|
16
|
+
function Va(a){this.va=a-24;this.Vb=function(b){F[this.va+4>>2]=b};this.Rb=function(b){F[this.va+8>>2]=b};this.Tb=function(){C[this.va>>2]=0};this.Mb=function(){D[this.va+12>>0]=0};this.Ub=function(){D[this.va+13>>0]=0};this.Ia=function(b,c){this.Jb();this.Vb(b);this.Rb(c);this.Tb();this.Mb();this.Ub()};this.Jb=function(){F[this.va+16>>2]=0}}
|
17
17
|
var Wa=0,Xa=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},Ya=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=Xa(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Za=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},$a=
|
18
18
|
a=>{if("/"===a)return"/";a=Ya(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)};function ab(){if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues){var a=new Uint8Array(1);return function(){crypto.getRandomValues(a);return a[0]}}if(fa)try{var b=require("crypto");return function(){return b.randomBytes(1)[0]}}catch(c){}return function(){x("randomDevice")}}
|
19
|
-
function bb(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:"/";if("string"!=typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Xa(a.split("/").filter(d=>!!d),!b).join("/");return(b?"/":"")+a||"."}var cb=[];function db(a,b){cb[a]={input:[],output:[],
|
20
|
-
var fb={open:function(a){var b=cb[a.node.rdev];if(!b)throw new J(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.
|
21
|
-
try{for(var e=0;e<d;e++)a.tty.
|
22
|
-
readline(),null!==b&&(b+="\n"));if(!b)return null;a.input=gb(b,!0)}return a.input.shift()},
|
23
|
-
createNode:function(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new J(63);K.Ea||(K.Ea={dir:{node:{
|
24
|
-
stream:jb}});c=kb(a,b,c,d);16384===(c.mode&61440)?(c.ua=K.Ea.dir.node,c.sa=K.Ea.dir.stream,c.ta={}):32768===(c.mode&61440)?(c.ua=K.Ea.file.node,c.sa=K.Ea.file.stream,c.xa=0,c.ta=null):40960===(c.mode&61440)?(c.ua=K.Ea.link.node,c.sa=K.Ea.link.stream):8192===(c.mode&61440)&&(c.ua=K.Ea.
|
25
|
-
b){var c=a.ta?a.ta.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.ta,a.ta=new Uint8Array(b),0<a.xa&&a.ta.set(c.subarray(0,a.xa),0))},
|
26
|
-
b.size=a.xa:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.
|
19
|
+
function bb(){for(var a="",b=!1,c=arguments.length-1;-1<=c&&!b;c--){b=0<=c?arguments[c]:"/";if("string"!=typeof b)throw new TypeError("Arguments to path.resolve must be strings");if(!b)return"";a=b+"/"+a;b="/"===b.charAt(0)}a=Xa(a.split("/").filter(d=>!!d),!b).join("/");return(b?"/":"")+a||"."}var cb=[];function db(a,b){cb[a]={input:[],output:[],Sa:b};eb(a,fb)}
|
20
|
+
var fb={open:function(a){var b=cb[a.node.rdev];if(!b)throw new J(43);a.tty=b;a.seekable=!1},close:function(a){a.tty.Sa.flush(a.tty)},flush:function(a){a.tty.Sa.flush(a.tty)},read:function(a,b,c,d){if(!a.tty||!a.tty.Sa.pb)throw new J(60);for(var e=0,f=0;f<d;f++){try{var k=a.tty.Sa.pb(a.tty)}catch(l){throw new J(29);}if(void 0===k&&0===e)throw new J(6);if(null===k||void 0===k)break;e++;b[c+f]=k}e&&(a.node.timestamp=Date.now());return e},write:function(a,b,c,d){if(!a.tty||!a.tty.Sa.fb)throw new J(60);
|
21
|
+
try{for(var e=0;e<d;e++)a.tty.Sa.fb(a.tty,b[c+e])}catch(f){throw new J(29);}d&&(a.node.timestamp=Date.now());return e}},hb={pb:function(a){if(!a.input.length){var b=null;if(fa){var c=Buffer.alloc(256),d=0;try{d=fs.readSync(process.stdin.fd,c,0,256,-1)}catch(e){if(e.toString().includes("EOF"))d=0;else throw e;}0<d?b=c.slice(0,d).toString("utf-8"):b=null}else"undefined"!=typeof window&&"function"==typeof window.prompt?(b=window.prompt("Input: "),null!==b&&(b+="\n")):"function"==typeof readline&&(b=
|
22
|
+
readline(),null!==b&&(b+="\n"));if(!b)return null;a.input=gb(b,!0)}return a.input.shift()},fb:function(a,b){null===b||10===b?(ma(ra(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(ma(ra(a.output,0)),a.output=[])}},ib={fb:function(a,b){null===b||10===b?(u(ra(a.output,0)),a.output=[]):0!=b&&a.output.push(b)},flush:function(a){a.output&&0<a.output.length&&(u(ra(a.output,0)),a.output=[])}},K={Ea:null,Ha:function(){return K.createNode(null,"/",16895,0)},
|
23
|
+
createNode:function(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new J(63);K.Ea||(K.Ea={dir:{node:{Ka:K.ua.Ka,Fa:K.ua.Fa,lookup:K.ua.lookup,Xa:K.ua.Xa,rename:K.ua.rename,unlink:K.ua.unlink,rmdir:K.ua.rmdir,readdir:K.ua.readdir,symlink:K.ua.symlink},stream:{La:K.sa.La}},file:{node:{Ka:K.ua.Ka,Fa:K.ua.Fa},stream:{La:K.sa.La,read:K.sa.read,write:K.sa.write,jb:K.sa.jb,qb:K.sa.qb,Za:K.sa.Za}},link:{node:{Ka:K.ua.Ka,Fa:K.ua.Fa,readlink:K.ua.readlink},stream:{}},kb:{node:{Ka:K.ua.Ka,Fa:K.ua.Fa},
|
24
|
+
stream:jb}});c=kb(a,b,c,d);16384===(c.mode&61440)?(c.ua=K.Ea.dir.node,c.sa=K.Ea.dir.stream,c.ta={}):32768===(c.mode&61440)?(c.ua=K.Ea.file.node,c.sa=K.Ea.file.stream,c.xa=0,c.ta=null):40960===(c.mode&61440)?(c.ua=K.Ea.link.node,c.sa=K.Ea.link.stream):8192===(c.mode&61440)&&(c.ua=K.Ea.kb.node,c.sa=K.Ea.kb.stream);c.timestamp=Date.now();a&&(a.ta[b]=c,a.timestamp=c.timestamp);return c},Yb:function(a){return a.ta?a.ta.subarray?a.ta.subarray(0,a.xa):new Uint8Array(a.ta):new Uint8Array(0)},mb:function(a,
|
25
|
+
b){var c=a.ta?a.ta.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.ta,a.ta=new Uint8Array(b),0<a.xa&&a.ta.set(c.subarray(0,a.xa),0))},Ib:function(a,b){if(a.xa!=b)if(0==b)a.ta=null,a.xa=0;else{var c=a.ta;a.ta=new Uint8Array(b);c&&a.ta.set(c.subarray(0,Math.min(b,a.xa)));a.xa=b}},ua:{Ka:function(a){var b={};b.dev=8192===(a.mode&61440)?a.id:1;b.ino=a.id;b.mode=a.mode;b.nlink=1;b.uid=0;b.gid=0;b.rdev=a.rdev;16384===(a.mode&61440)?b.size=4096:32768===(a.mode&61440)?
|
26
|
+
b.size=a.xa:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.atime=new Date(a.timestamp);b.mtime=new Date(a.timestamp);b.ctime=new Date(a.timestamp);b.ub=4096;b.blocks=Math.ceil(b.size/b.ub);return b},Fa:function(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);void 0!==b.size&&K.Ib(a,b.size)},lookup:function(){throw lb[44];},Xa:function(a,b,c,d){return K.createNode(a,b,c,d)},rename:function(a,b,c){if(16384===(a.mode&61440)){try{var d=mb(b,c)}catch(f){}if(d)for(var e in d.ta)throw new J(55);
|
27
27
|
}delete a.parent.ta[a.name];a.parent.timestamp=Date.now();a.name=c;b.ta[c]=a;b.timestamp=a.parent.timestamp;a.parent=b},unlink:function(a,b){delete a.ta[b];a.timestamp=Date.now()},rmdir:function(a,b){var c=mb(a,b),d;for(d in c.ta)throw new J(55);delete a.ta[b];a.timestamp=Date.now()},readdir:function(a){var b=[".",".."],c;for(c in a.ta)a.ta.hasOwnProperty(c)&&b.push(c);return b},symlink:function(a,b,c){a=K.createNode(a,b,41471,0);a.link=c;return a},readlink:function(a){if(40960!==(a.mode&61440))throw new J(28);
|
28
|
-
return a.link}},sa:{read:function(a,b,c,d,e){var f=a.node.ta;if(e>=a.node.xa)return 0;a=Math.min(a.node.xa-e,d);if(8<a&&f.subarray)b.set(f.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=f[e+d];return a},write:function(a,b,c,d,e,f){b.buffer===D.buffer&&(f=!1);if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.ta||a.ta.subarray)){if(f)return a.ta=b.subarray(c,c+d),a.xa=d;if(0===a.xa&&0===e)return a.ta=b.slice(c,c+d),a.xa=d;if(e+d<=a.xa)return a.ta.set(b.subarray(c,c+d),e),d}K.
|
29
|
-
d);if(a.ta.subarray&&b.subarray)a.ta.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.ta[e+f]=b[c+f];a.xa=Math.max(a.xa,e+d);return d},
|
30
|
-
c,c+b);c=!0;b=65536*Math.ceil(b/65536);(e=nb(65536,b))?(z.fill(0,e,e+b),b=e):b=0;if(!b)throw new J(48);D.set(a,b)}else c=!1,b=a.byteOffset;return{va:b,
|
31
|
-
e=0;e<a.length;e++){var f=e===a.length-1;if(f&&b.parent)break;c=mb(c,a[e]);d=Ya(d+"/"+a[e]);c.
|
32
|
-
{var c;if(c=(c=wb(a,"x"))?c:a.ua.lookup?0:2)throw new J(c,a);for(c=rb[vb(a.id,b)];c;c=c.
|
33
|
-
return 0},Ab=(a,b)=>{try{return mb(a,b),20}catch(c){}return wb(a,"wx")},Bb=(a=0)=>{for(;4096>=a;a++)if(!L[a])return a;throw new J(33);},Db=(a,b)=>{Cb||(Cb=function(){this
|
34
|
-
(a,b)=>{pb[a]={sa:b}},Eb=(a,b)=>{var c="/"===b,d=!b;if(c&&ob)throw new J(10);if(!c&&!d){var e=M(b,{
|
35
|
-
b,b=438);N(a,b|8192,c)},Gb=(a,b)=>{if(!bb(a))throw new J(44);var c=M(b,{parent:!0}).node;if(!c)throw new J(44);b=$a(b);var d=Ab(c,b);if(d)throw new J(d);if(!c.ua.symlink)throw new J(63);c.ua.symlink(c,b,a)},tb=a=>{a=M(a).node;if(!a)throw new J(44);if(!a.ua.readlink)throw new J(28);return bb(ub(a.parent),a.ua.readlink(a))},Ib=(a,b,c)=>{if(""===a)throw new J(44);if("string"==typeof b){var d=
|
36
|
-
c)&4095|32768:0;if("object"==typeof a)var e=a;else{a=Ya(a);try{e=M(a,{
|
37
|
-
if(32768!==(c.mode&61440))throw new J(28);if(d=wb(c,"w"))throw new J(d);c.ua.Fa(c,{size:0,timestamp:Date.now()})}b&=-131713;e=Db({node:e,path:ub(e),flags:b,seekable:!0,position:0,sa:e.sa,
|
38
|
-
c};this.
|
39
|
-
void 0===t)break;p++;k[l+q]=t}p&&(f.node.timestamp=Date.now());return p},write:(f,k,l,m)=>{for(var p=0;p<m;p++)try{c(k[l+p])}catch(q){throw new J(29);}m&&(f.node.timestamp=Date.now());return p}});Fb(a,d,e)},Nb,O={},Cb,Hb,Pb=void 0;function P(){Pb+=4;return C[Pb-4>>2]}function Q(a){a=L[a];if(!a)throw new J(8);return a}
|
40
|
-
function R(a){for(var b="";z[a];)b+=Rb[z[a++]];return b}var Sb={},S={},Tb={};function Ub(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}
|
41
|
-
function Wb(a){var b=Error,c=Vb(a,function(d){this.name=a;this.message=d;d=Error(d).stack;void 0!==d&&(this.stack=this.toString()+"\n"+d.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}
|
42
|
-
function $b(a,b,c){function d(l){l=c(l);l.length!==a.length&&Zb("Mismatched type converter count");for(var m=0;m<a.length;++m)U(a[m],l[m])}a.forEach(function(l){Tb[l]=b});var e=Array(b.length),f=[],k=0;b.forEach((l,m)=>{S.hasOwnProperty(l)?e[m]=S[l]:(f.push(l),Sb.hasOwnProperty(l)||(Sb[l]=[]),Sb[l].push(()=>{e[m]=S[l];++k;k===f.length&&d(e)}))});0===f.length&&d(e)}
|
43
|
-
function U(a,b,c={}){if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var d=b.name;a||T('type "'+d+'" must have a positive integer typeid pointer');if(S.hasOwnProperty(a)){if(c.
|
44
|
-
function dc(a){--a.count.value;0===a.count.value&&(a.Aa?a.Ba.
|
28
|
+
return a.link}},sa:{read:function(a,b,c,d,e){var f=a.node.ta;if(e>=a.node.xa)return 0;a=Math.min(a.node.xa-e,d);if(8<a&&f.subarray)b.set(f.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=f[e+d];return a},write:function(a,b,c,d,e,f){b.buffer===D.buffer&&(f=!1);if(!d)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.ta||a.ta.subarray)){if(f)return a.ta=b.subarray(c,c+d),a.xa=d;if(0===a.xa&&0===e)return a.ta=b.slice(c,c+d),a.xa=d;if(e+d<=a.xa)return a.ta.set(b.subarray(c,c+d),e),d}K.mb(a,e+
|
29
|
+
d);if(a.ta.subarray&&b.subarray)a.ta.set(b.subarray(c,c+d),e);else for(f=0;f<d;f++)a.ta[e+f]=b[c+f];a.xa=Math.max(a.xa,e+d);return d},La:function(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.xa);if(0>b)throw new J(28);return b},jb:function(a,b,c){K.mb(a.node,b+c);a.node.xa=Math.max(a.node.xa,b+c)},qb:function(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new J(43);a=a.node.ta;if(e&2||a.buffer!==Ca){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,
|
30
|
+
c,c+b);c=!0;b=65536*Math.ceil(b/65536);(e=nb(65536,b))?(z.fill(0,e,e+b),b=e):b=0;if(!b)throw new J(48);D.set(a,b)}else c=!1,b=a.byteOffset;return{va:b,Wb:c}},Za:function(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new J(43);if(e&2)return 0;K.sa.write(a,b,0,d,c,!1);return 0}}},ob=null,pb={},L=[],qb=1,rb=null,sb=!0,J=null,lb={},M=(a,b={})=>{a=bb("/",a);if(!a)return{path:"",node:null};b=Object.assign({ob:!0,gb:0},b);if(8<b.gb)throw new J(32);a=Xa(a.split("/").filter(k=>!!k),!1);for(var c=ob,d="/",
|
31
|
+
e=0;e<a.length;e++){var f=e===a.length-1;if(f&&b.parent)break;c=mb(c,a[e]);d=Ya(d+"/"+a[e]);c.Ya&&(!f||f&&b.ob)&&(c=c.Ya.root);if(!f||b.nb)for(f=0;40960===(c.mode&61440);)if(c=tb(d),d=bb(Za(d),c),c=M(d,{gb:b.gb+1}).node,40<f++)throw new J(32);}return{path:d,node:c}},ub=a=>{for(var b;;){if(a===a.parent)return a=a.Ha.rb,b?"/"!==a[a.length-1]?a+"/"+b:a+b:a;b=b?a.name+"/"+b:a.name;a=a.parent}},vb=(a,b)=>{for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%rb.length},mb=(a,b)=>
|
32
|
+
{var c;if(c=(c=wb(a,"x"))?c:a.ua.lookup?0:2)throw new J(c,a);for(c=rb[vb(a.id,b)];c;c=c.Db){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.ua.lookup(a,b)},kb=(a,b,c,d)=>{a=new xb(a,b,c,d);b=vb(a.parent.id,a.name);a.Db=rb[b];return rb[b]=a},yb={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},zb=a=>{var b=["r","w","rw"][a&3];a&512&&(b+="w");return b},wb=(a,b)=>{if(sb)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;
|
33
|
+
return 0},Ab=(a,b)=>{try{return mb(a,b),20}catch(c){}return wb(a,"wx")},Bb=(a=0)=>{for(;4096>=a;a++)if(!L[a])return a;throw new J(33);},Db=(a,b)=>{Cb||(Cb=function(){this.Ia={}},Cb.prototype={},Object.defineProperties(Cb.prototype,{object:{get:function(){return this.node},set:function(c){this.node=c}},flags:{get:function(){return this.Ia.flags},set:function(c){this.Ia.flags=c}},position:{get:function(){return this.Ia.position},set:function(c){this.Ia.position=c}}}));a=Object.assign(new Cb,a);b=Bb(b);
|
34
|
+
a.fd=b;return L[b]=a},jb={open:a=>{a.sa=pb[a.node.rdev].sa;a.sa.open&&a.sa.open(a)},La:()=>{throw new J(70);}},eb=(a,b)=>{pb[a]={sa:b}},Eb=(a,b)=>{var c="/"===b,d=!b;if(c&&ob)throw new J(10);if(!c&&!d){var e=M(b,{ob:!1});b=e.path;e=e.node;if(e.Ya)throw new J(10);if(16384!==(e.mode&61440))throw new J(54);}b={type:a,$b:{},rb:b,Cb:[]};a=a.Ha(b);a.Ha=b;b.root=a;c?ob=a:e&&(e.Ya=b,e.Ha&&e.Ha.Cb.push(b))},N=(a,b,c)=>{var d=M(a,{parent:!0}).node;a=$a(a);if(!a||"."===a||".."===a)throw new J(28);var e=Ab(d,
|
35
|
+
a);if(e)throw new J(e);if(!d.ua.Xa)throw new J(63);return d.ua.Xa(d,a,b,c)},Fb=(a,b,c)=>{"undefined"==typeof c&&(c=b,b=438);N(a,b|8192,c)},Gb=(a,b)=>{if(!bb(a))throw new J(44);var c=M(b,{parent:!0}).node;if(!c)throw new J(44);b=$a(b);var d=Ab(c,b);if(d)throw new J(d);if(!c.ua.symlink)throw new J(63);c.ua.symlink(c,b,a)},tb=a=>{a=M(a).node;if(!a)throw new J(44);if(!a.ua.readlink)throw new J(28);return bb(ub(a.parent),a.ua.readlink(a))},Ib=(a,b,c)=>{if(""===a)throw new J(44);if("string"==typeof b){var d=
|
36
|
+
yb[b];if("undefined"==typeof d)throw Error("Unknown file open mode: "+b);b=d}c=b&64?("undefined"==typeof c?438:c)&4095|32768:0;if("object"==typeof a)var e=a;else{a=Ya(a);try{e=M(a,{nb:!(b&131072)}).node}catch(f){}}d=!1;if(b&64)if(e){if(b&128)throw new J(20);}else e=N(a,c,0),d=!0;if(!e)throw new J(44);8192===(e.mode&61440)&&(b&=-513);if(b&65536&&16384!==(e.mode&61440))throw new J(54);if(!d&&(c=e?40960===(e.mode&61440)?32:16384===(e.mode&61440)&&("r"!==zb(b)||b&512)?31:wb(e,zb(b)):44))throw new J(c);
|
37
|
+
if(b&512&&!d){c=e;c="string"==typeof c?M(c,{nb:!0}).node:c;if(!c.ua.Fa)throw new J(63);if(16384===(c.mode&61440))throw new J(31);if(32768!==(c.mode&61440))throw new J(28);if(d=wb(c,"w"))throw new J(d);c.ua.Fa(c,{size:0,timestamp:Date.now()})}b&=-131713;e=Db({node:e,path:ub(e),flags:b,seekable:!0,position:0,sa:e.sa,Sb:[],error:!1});e.sa.open&&e.sa.open(e);!g.logReadFiles||b&1||(Hb||(Hb={}),a in Hb||(Hb[a]=1));return e},Jb=(a,b,c)=>{if(null===a.fd)throw new J(8);if(!a.seekable||!a.sa.La)throw new J(70);
|
38
|
+
if(0!=c&&1!=c&&2!=c)throw new J(28);a.position=a.sa.La(a,b,c);a.Sb=[]},Kb=()=>{J||(J=function(a,b){this.node=b;this.Kb=function(c){this.Ja=c};this.Kb(a);this.message="FS error"},J.prototype=Error(),J.prototype.constructor=J,[44].forEach(a=>{lb[a]=new J(a);lb[a].stack="<generic error, no stack>"}))},Lb,Mb=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},Ob=(a,b,c)=>{a=Ya("/dev/"+a);var d=Mb(!!b,!!c);Nb||(Nb=64);var e=Nb++<<8|0;eb(e,{open:f=>{f.seekable=!1},close:()=>{c&&c.buffer&&c.buffer.length&&
|
39
|
+
c(10)},read:(f,k,l,m)=>{for(var p=0,q=0;q<m;q++){try{var t=b()}catch(v){throw new J(29);}if(void 0===t&&0===p)throw new J(6);if(null===t||void 0===t)break;p++;k[l+q]=t}p&&(f.node.timestamp=Date.now());return p},write:(f,k,l,m)=>{for(var p=0;p<m;p++)try{c(k[l+p])}catch(q){throw new J(29);}m&&(f.node.timestamp=Date.now());return p}});Fb(a,d,e)},Nb,O={},Cb,Hb,Pb=void 0;function P(){Pb+=4;return C[Pb-4>>2]}function Q(a){a=L[a];if(!a)throw new J(8);return a}
|
40
|
+
function Qb(a){switch(a){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+a);}}var Rb=void 0;function R(a){for(var b="";z[a];)b+=Rb[z[a++]];return b}var Sb={},S={},Tb={};function Ub(a){if(void 0===a)return"_unknown";a=a.replace(/[^a-zA-Z0-9_]/g,"$");var b=a.charCodeAt(0);return 48<=b&&57>=b?"_"+a:a}
|
41
|
+
function Vb(a,b){a=Ub(a);return(new Function("body","return function "+a+'() {\n "use strict"; return body.apply(this, arguments);\n};\n'))(b)}function Wb(a){var b=Error,c=Vb(a,function(d){this.name=a;this.message=d;d=Error(d).stack;void 0!==d&&(this.stack=this.toString()+"\n"+d.replace(/^Error(:[^\n]*)?\n/,""))});c.prototype=Object.create(b.prototype);c.prototype.constructor=c;c.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message};return c}
|
42
|
+
var Xb=void 0;function T(a){throw new Xb(a);}var Yb=void 0;function Zb(a){throw new Yb(a);}function $b(a,b,c){function d(l){l=c(l);l.length!==a.length&&Zb("Mismatched type converter count");for(var m=0;m<a.length;++m)U(a[m],l[m])}a.forEach(function(l){Tb[l]=b});var e=Array(b.length),f=[],k=0;b.forEach((l,m)=>{S.hasOwnProperty(l)?e[m]=S[l]:(f.push(l),Sb.hasOwnProperty(l)||(Sb[l]=[]),Sb[l].push(()=>{e[m]=S[l];++k;k===f.length&&d(e)}))});0===f.length&&d(e)}
|
43
|
+
function U(a,b,c={}){if(!("argPackAdvance"in b))throw new TypeError("registerType registeredInstance requires argPackAdvance");var d=b.name;a||T('type "'+d+'" must have a positive integer typeid pointer');if(S.hasOwnProperty(a)){if(c.zb)return;T("Cannot register type '"+d+"' twice")}S[a]=b;delete Tb[a];Sb.hasOwnProperty(a)&&(b=Sb[a],delete Sb[a],b.forEach(e=>e()))}function ac(a){T(a.ra.ya.wa.name+" instance already deleted")}var bc=!1;function cc(){}
|
44
|
+
function dc(a){--a.count.value;0===a.count.value&&(a.Aa?a.Ba.Ma(a.Aa):a.ya.wa.Ma(a.va))}function ec(a,b,c){if(b===c)return a;if(void 0===c.Ca)return null;a=ec(a,b,c.Ca);return null===a?null:c.wb(a)}var fc={},gc=[];function hc(){for(;gc.length;){var a=gc.pop();a.ra.Qa=!1;a["delete"]()}}var ic=void 0,jc={};function kc(a,b){for(void 0===b&&T("ptr should not be undefined");a.Ca;)b=a.Ua(b),a=a.Ca;return jc[b]}
|
45
45
|
function lc(a,b){b.ya&&b.va||Zb("makeClassHandle requires ptr and ptrType");!!b.Ba!==!!b.Aa&&Zb("Both smartPtrType and smartPtr must be specified");b.count={value:1};return mc(Object.create(a,{ra:{value:b}}))}function mc(a){if("undefined"===typeof FinalizationRegistry)return mc=b=>b,a;bc=new FinalizationRegistry(b=>{dc(b.ra)});mc=b=>{var c=b.ra;c.Aa&&bc.register(b,{ra:c},b);return b};cc=b=>{bc.unregister(b)};return mc(a)}function V(){}
|
46
|
-
function nc(a,b,c){if(void 0===a[b].za){var d=a[b];a[b]=function(){a[b].za.hasOwnProperty(arguments.length)||T("Function '"+c+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[b].za+")!");return a[b].za[arguments.length].apply(this,arguments)};a[b].za=[];a[b].za[d.
|
47
|
-
function oc(a,b,c){g.hasOwnProperty(a)?((void 0===c||void 0!==g[a].za&&void 0!==g[a].za[c])&&T("Cannot register public name '"+a+"' twice"),nc(g,a,a),g.hasOwnProperty(c)&&T("Cannot register multiple overloads of a function with the same number of arguments ("+c+")!"),g[a].za[c]=b):(g[a]=b,void 0!==c&&(g[a].
|
48
|
-
function qc(a,b,c){for(;b!==c;)b.
|
49
|
-
function tc(a,b){if(null===b){this.
|
50
|
-
this.
|
51
|
-
function vc(a,b){if(null===b)return this.
|
52
|
-
function W(a,b,c,d){this.name=a;this.wa=b;this.
|
46
|
+
function nc(a,b,c){if(void 0===a[b].za){var d=a[b];a[b]=function(){a[b].za.hasOwnProperty(arguments.length)||T("Function '"+c+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+a[b].za+")!");return a[b].za[arguments.length].apply(this,arguments)};a[b].za=[];a[b].za[d.Pa]=d}}
|
47
|
+
function oc(a,b,c){g.hasOwnProperty(a)?((void 0===c||void 0!==g[a].za&&void 0!==g[a].za[c])&&T("Cannot register public name '"+a+"' twice"),nc(g,a,a),g.hasOwnProperty(c)&&T("Cannot register multiple overloads of a function with the same number of arguments ("+c+")!"),g[a].za[c]=b):(g[a]=b,void 0!==c&&(g[a].Zb=c))}function pc(a,b,c,d,e,f,k,l){this.name=a;this.constructor=b;this.Ra=c;this.Ma=d;this.Ca=e;this.xb=f;this.Ua=k;this.wb=l;this.Fb=[]}
|
48
|
+
function qc(a,b,c){for(;b!==c;)b.Ua||T("Expected null or instance of "+c.name+", got an instance of "+b.name),a=b.Ua(a),b=b.Ca;return a}function rc(a,b){if(null===b)return this.eb&&T("null is not a valid "+this.name),0;b.ra||T('Cannot pass "'+sc(b)+'" as a '+this.name);b.ra.va||T("Cannot pass deleted object as a pointer of type "+this.name);return qc(b.ra.va,b.ra.ya.wa,this.wa)}
|
49
|
+
function tc(a,b){if(null===b){this.eb&&T("null is not a valid "+this.name);if(this.Wa){var c=this.Gb();null!==a&&a.push(this.Ma,c);return c}return 0}b.ra||T('Cannot pass "'+sc(b)+'" as a '+this.name);b.ra.va||T("Cannot pass deleted object as a pointer of type "+this.name);!this.Va&&b.ra.ya.Va&&T("Cannot convert argument of type "+(b.ra.Ba?b.ra.Ba.name:b.ra.ya.name)+" to parameter type "+this.name);c=qc(b.ra.va,b.ra.ya.wa,this.wa);if(this.Wa)switch(void 0===b.ra.Aa&&T("Passing raw pointer to smart pointer is illegal"),
|
50
|
+
this.Lb){case 0:b.ra.Ba===this?c=b.ra.Aa:T("Cannot convert argument of type "+(b.ra.Ba?b.ra.Ba.name:b.ra.ya.name)+" to parameter type "+this.name);break;case 1:c=b.ra.Aa;break;case 2:if(b.ra.Ba===this)c=b.ra.Aa;else{var d=b.clone();c=this.Hb(c,uc(function(){d["delete"]()}));null!==a&&a.push(this.Ma,c)}break;default:T("Unsupporting sharing policy")}return c}
|
51
|
+
function vc(a,b){if(null===b)return this.eb&&T("null is not a valid "+this.name),0;b.ra||T('Cannot pass "'+sc(b)+'" as a '+this.name);b.ra.va||T("Cannot pass deleted object as a pointer of type "+this.name);b.ra.ya.Va&&T("Cannot convert argument of type "+b.ra.ya.name+" to parameter type "+this.name);return qc(b.ra.va,b.ra.ya.wa,this.wa)}function wc(a){return this.fromWireType(F[a>>2])}
|
52
|
+
function W(a,b,c,d){this.name=a;this.wa=b;this.eb=c;this.Va=d;this.Wa=!1;this.Ma=this.Hb=this.Gb=this.tb=this.Lb=this.Eb=void 0;void 0!==b.Ca?this.toWireType=tc:(this.toWireType=d?rc:vc,this.Da=null)}function xc(a,b,c){g.hasOwnProperty(a)||Zb("Replacing nonexistant public symbol");void 0!==g[a].za&&void 0!==c?g[a].za[c]=b:(g[a]=b,g[a].Pa=c)}
|
53
53
|
function yc(a,b){var c=[];return function(){c.length=0;Object.assign(c,arguments);if(a.includes("j")){var d=g["dynCall_"+a];d=c&&c.length?d.apply(null,[b].concat(c)):d.call(null,b)}else d=Ta(b).apply(null,c);return d}}function X(a,b){a=R(a);var c=a.includes("j")?yc(a,b):Ta(b);"function"!=typeof c&&T("unknown function pointer with signature "+a+": "+b);return c}var zc=void 0;function Ac(a){a=Bc(a);var b=R(a);Y(a);return b}
|
54
54
|
function Ec(a,b){function c(f){e[f]||S[f]||(Tb[f]?Tb[f].forEach(c):(d.push(f),e[f]=!0))}var d=[],e={};b.forEach(c);throw new zc(a+": "+d.map(Ac).join([", "]));}function Fc(a){var b=Function;if(!(b instanceof Function))throw new TypeError("new_ called with constructor type "+typeof b+" which is not a function");var c=Vb(b.name||"unknownFunctionName",function(){});c.prototype=b.prototype;c=new c;a=b.apply(c,a);return a instanceof Object?a:c}function Gc(a){for(;a.length;){var b=a.pop();a.pop()(b)}}
|
55
55
|
function Hc(a,b,c,d,e){var f=b.length;2>f&&T("argTypes array size mismatch! Must at least get return value and 'this' types!");var k=null!==b[1]&&null!==c,l=!1;for(c=1;c<b.length;++c)if(null!==b[c]&&void 0===b[c].Da){l=!0;break}var m="void"!==b[0].name,p="",q="";for(c=0;c<f-2;++c)p+=(0!==c?", ":"")+"arg"+c,q+=(0!==c?", ":"")+"arg"+c+"Wired";a="return function "+Ub(a)+"("+p+") {\nif (arguments.length !== "+(f-2)+") {\nthrowBindingError('function "+a+" called with ' + arguments.length + ' arguments, expected "+
|
56
56
|
(f-2)+" args!');\n}\n";l&&(a+="var destructors = [];\n");var t=l?"destructors":"null";p="throwBindingError invoker fn runDestructors retType classParam".split(" ");d=[T,d,e,Gc,b[0],b[1]];k&&(a+="var thisWired = classParam.toWireType("+t+", this);\n");for(c=0;c<f-2;++c)a+="var arg"+c+"Wired = argType"+c+".toWireType("+t+", arg"+c+"); // "+b[c+2].name+"\n",p.push("argType"+c),d.push(b[c+2]);k&&(q="thisWired"+(0<q.length?", ":"")+q);a+=(m?"var rv = ":"")+"invoker(fn"+(0<q.length?", ":"")+q+");\n";if(l)a+=
|
57
|
-
"runDestructors(destructors);\n";else for(c=k?1:2;c<b.length;++c)f=1===c?"thisWired":"arg"+(c-2)+"Wired",null!==b[c].Da&&(a+=f+"_dtor("+f+"); // "+b[c].name+"\n",p.push(f+"_dtor"),d.push(b[c].Da));m&&(a+="var ret = retType.fromWireType(rv);\nreturn ret;\n");p.push(a+"}\n");return Fc(p).apply(null,d)}function Ic(a,b){for(var c=[],d=0;d<a;d++)c.push(C[(b>>2)+d]);return c}var Jc=[],Z=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Kc(a){4<a&&0===--Z[a].
|
58
|
-
var Lc=a=>{a||T("Cannot use deleted val. handle = "+a);return Z[a].value},uc=a=>{switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Jc.length?Jc.pop():Z.length;Z[b]={
|
57
|
+
"runDestructors(destructors);\n";else for(c=k?1:2;c<b.length;++c)f=1===c?"thisWired":"arg"+(c-2)+"Wired",null!==b[c].Da&&(a+=f+"_dtor("+f+"); // "+b[c].name+"\n",p.push(f+"_dtor"),d.push(b[c].Da));m&&(a+="var ret = retType.fromWireType(rv);\nreturn ret;\n");p.push(a+"}\n");return Fc(p).apply(null,d)}function Ic(a,b){for(var c=[],d=0;d<a;d++)c.push(C[(b>>2)+d]);return c}var Jc=[],Z=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function Kc(a){4<a&&0===--Z[a].hb&&(Z[a]=void 0,Jc.push(a))}
|
58
|
+
var Lc=a=>{a||T("Cannot use deleted val. handle = "+a);return Z[a].value},uc=a=>{switch(a){case void 0:return 1;case null:return 2;case !0:return 3;case !1:return 4;default:var b=Jc.length?Jc.pop():Z.length;Z[b]={hb:1,value:a};return b}};
|
59
59
|
function Mc(a,b,c){switch(b){case 0:return function(d){return this.fromWireType((c?D:z)[d])};case 1:return function(d){return this.fromWireType((c?B:wa)[d>>1])};case 2:return function(d){return this.fromWireType((c?C:F)[d>>2])};default:throw new TypeError("Unknown integer type: "+a);}}function Nc(a,b){var c=S[a];void 0===c&&T(b+" has unknown type "+Ac(a));return c}function sc(a){if(null===a)return"null";var b=typeof a;return"object"===b||"array"===b||"function"===b?a.toString():""+a}
|
60
60
|
function Oc(a,b){switch(b){case 2:return function(c){return this.fromWireType(Da[c>>2])};case 3:return function(c){return this.fromWireType(Ea[c>>3])};default:throw new TypeError("Unknown float type: "+a);}}
|
61
61
|
function Pc(a,b,c){switch(b){case 0:return c?function(d){return D[d]}:function(d){return z[d]};case 1:return c?function(d){return B[d>>1]}:function(d){return wa[d>>1]};case 2:return c?function(d){return C[d>>2]}:function(d){return F[d>>2]};default:throw new TypeError("Unknown integer type: "+a);}}var Qc={};function Rc(a){var b=Qc[a];return void 0===b?R(a):b}var Sc=[];function Tc(){return"object"==typeof globalThis?globalThis:Function("return this")()}
|
62
|
-
function Uc(a){var b=Sc.length;Sc.push(a);return b}function Vc(a,b){for(var c=Array(a),d=0;d<a;++d)c[d]=Nc(
|
63
|
-
function Zc(){if(!$c){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ba||"./this.program"},b;for(b in Yc)void 0===Yc[b]?delete a[b]:a[b]=Yc[b];var c=[];for(b in a)c.push(b+"="+a[b]);$c=c}return $c}var $c;function ad(a,b){ad.
|
62
|
+
function Uc(a){var b=Sc.length;Sc.push(a);return b}function Vc(a,b){for(var c=Array(a),d=0;d<a;++d)c[d]=Nc(F[b+4*d>>2],"parameter "+d);return c}var Wc=[],Xc={},Yc={};
|
63
|
+
function Zc(){if(!$c){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:ba||"./this.program"},b;for(b in Yc)void 0===Yc[b]?delete a[b]:a[b]=Yc[b];var c=[];for(b in a)c.push(b+"="+a[b]);$c=c}return $c}var $c;function ad(a,b){ad.sb||(ad.sb=ab());for(var c=0;c<b;c++)D[a+c>>0]=ad.sb();return 0}function bd(a){return 0===a%4&&(0!==a%100||0===a%400)}
|
64
64
|
var cd=[31,29,31,30,31,30,31,31,30,31,30,31],dd=[31,28,31,30,31,30,31,31,30,31,30,31];
|
65
65
|
function ed(a,b,c,d){function e(h,r,w){for(h="number"==typeof h?h.toString():h||"";h.length<r;)h=w[0]+h;return h}function f(h,r){return e(h,r,"0")}function k(h,r){function w(E){return 0>E?-1:0<E?1:0}var A;0===(A=w(h.getFullYear()-r.getFullYear()))&&0===(A=w(h.getMonth()-r.getMonth()))&&(A=w(h.getDate()-r.getDate()));return A}function l(h){switch(h.getDay()){case 0:return new Date(h.getFullYear()-1,11,29);case 1:return h;case 2:return new Date(h.getFullYear(),0,3);case 3:return new Date(h.getFullYear(),
|
66
|
-
0,2);case 4:return new Date(h.getFullYear(),0,1);case 5:return new Date(h.getFullYear()-1,11,31);case 6:return new Date(h.getFullYear()-1,11,30)}}function m(h){var r=h.
|
67
|
-
0,4));w=l(w);return 0>=k(r,h)?0>=k(w,h)?h.getFullYear()+1:h.getFullYear():h.getFullYear()-1}var p=C[d+40>>2];d={
|
68
|
-
"%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var q in p)c=c.replace(new RegExp(q,"g"),p[q]);var t="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),v="January February March April May June July August September October November December".split(" ");p={"%a":function(h){return t[h.Ga].substring(0,3)},"%A":function(h){return t[h.Ga]},"%b":function(h){return v[h.
|
69
|
-
"%C":function(h){return f((h.
|
70
|
-
h
|
71
|
-
"%y":function(h){return(h.
|
72
|
-
function xb(a,b,c,d){a||(a=this);this.parent=a;this.Ha=a.Ha;this.
|
66
|
+
0,2);case 4:return new Date(h.getFullYear(),0,1);case 5:return new Date(h.getFullYear()-1,11,31);case 6:return new Date(h.getFullYear()-1,11,30)}}function m(h){var r=h.Na;for(h=new Date((new Date(h.Oa+1900,0,1)).getTime());0<r;){var w=h.getMonth(),A=(bd(h.getFullYear())?cd:dd)[w];if(r>A-h.getDate())r-=A-h.getDate()+1,h.setDate(1),11>w?h.setMonth(w+1):(h.setMonth(0),h.setFullYear(h.getFullYear()+1));else{h.setDate(h.getDate()+r);break}}w=new Date(h.getFullYear()+1,0,4);r=l(new Date(h.getFullYear(),
|
67
|
+
0,4));w=l(w);return 0>=k(r,h)?0>=k(w,h)?h.getFullYear()+1:h.getFullYear():h.getFullYear()-1}var p=C[d+40>>2];d={Pb:C[d>>2],Ob:C[d+4>>2],$a:C[d+8>>2],ib:C[d+12>>2],ab:C[d+16>>2],Oa:C[d+20>>2],Ga:C[d+24>>2],Na:C[d+28>>2],ac:C[d+32>>2],Nb:C[d+36>>2],Qb:p?y(p):""};c=y(c);p={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d",
|
68
|
+
"%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var q in p)c=c.replace(new RegExp(q,"g"),p[q]);var t="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),v="January February March April May June July August September October November December".split(" ");p={"%a":function(h){return t[h.Ga].substring(0,3)},"%A":function(h){return t[h.Ga]},"%b":function(h){return v[h.ab].substring(0,3)},"%B":function(h){return v[h.ab]},
|
69
|
+
"%C":function(h){return f((h.Oa+1900)/100|0,2)},"%d":function(h){return f(h.ib,2)},"%e":function(h){return e(h.ib,2," ")},"%g":function(h){return m(h).toString().substring(2)},"%G":function(h){return m(h)},"%H":function(h){return f(h.$a,2)},"%I":function(h){h=h.$a;0==h?h=12:12<h&&(h-=12);return f(h,2)},"%j":function(h){for(var r=0,w=0;w<=h.ab-1;r+=(bd(h.Oa+1900)?cd:dd)[w++]);return f(h.ib+r,3)},"%m":function(h){return f(h.ab+1,2)},"%M":function(h){return f(h.Ob,2)},"%n":function(){return"\n"},"%p":function(h){return 0<=
|
70
|
+
h.$a&&12>h.$a?"AM":"PM"},"%S":function(h){return f(h.Pb,2)},"%t":function(){return"\t"},"%u":function(h){return h.Ga||7},"%U":function(h){return f(Math.floor((h.Na+7-h.Ga)/7),2)},"%V":function(h){var r=Math.floor((h.Na+7-(h.Ga+6)%7)/7);2>=(h.Ga+371-h.Na-2)%7&&r++;if(r)53==r&&(w=(h.Ga+371-h.Na)%7,4==w||3==w&&bd(h.Oa)||(r=1));else{r=52;var w=(h.Ga+7-h.Na-1)%7;(4==w||5==w&&bd(h.Oa%400-1))&&r++}return f(r,2)},"%w":function(h){return h.Ga},"%W":function(h){return f(Math.floor((h.Na+7-(h.Ga+6)%7)/7),2)},
|
71
|
+
"%y":function(h){return(h.Oa+1900).toString().substring(2)},"%Y":function(h){return h.Oa+1900},"%z":function(h){h=h.Nb;var r=0<=h;h=Math.abs(h)/60;return(r?"+":"-")+String("0000"+(h/60*100+h%60)).slice(-4)},"%Z":function(h){return h.Qb},"%%":function(){return"%"}};c=c.replace(/%%/g,"\x00\x00");for(q in p)c.includes(q)&&(c=c.replace(new RegExp(q,"g"),p[q](d)));c=c.replace(/\0\0/g,"%");q=gb(c,!1);if(q.length>b)return 0;D.set(q,a);return q.length-1}
|
72
|
+
function xb(a,b,c,d){a||(a=this);this.parent=a;this.Ha=a.Ha;this.Ya=null;this.id=qb++;this.name=b;this.mode=c;this.ua={};this.sa={};this.rdev=d}Object.defineProperties(xb.prototype,{read:{get:function(){return 365===(this.mode&365)},set:function(a){a?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146===(this.mode&146)},set:function(a){a?this.mode|=146:this.mode&=-147}}});Kb();rb=Array(4096);Eb(K,"/");N("/tmp",16895,0);N("/home",16895,0);N("/home/web_user",16895,0);
|
73
73
|
(()=>{N("/dev",16895,0);eb(259,{read:()=>0,write:(b,c,d,e)=>e});Fb("/dev/null",259);db(1280,hb);db(1536,ib);Fb("/dev/tty",1280);Fb("/dev/tty1",1536);var a=ab();Ob("random",a);Ob("urandom",a);N("/dev/shm",16895,0);N("/dev/shm/tmp",16895,0)})();
|
74
|
-
(()=>{N("/proc",16895,0);var a=N("/proc/self",16895,0);N("/proc/self/fd",16895,0);Eb({Ha:()=>{var b=kb(a,"fd",16895,73);b.ua={lookup:(c,d)=>{var e=L[+d];if(!e)throw new J(8);c={parent:null,Ha:{
|
75
|
-
V.prototype.isAliasOf=function(a){if(!(this instanceof V&&a instanceof V))return!1;var b=this.ra.ya.wa,c=this.ra.va,d=a.ra.ya.wa;for(a=a.ra.va;b.Ca;)c=b.
|
76
|
-
V.prototype.clone=function(){this.ra.va||ac(this);if(this.ra.
|
77
|
-
V.prototype.isDeleted=function(){return!this.ra.va};V.prototype.deleteLater=function(){this.ra.va||ac(this);this.ra.
|
78
|
-
W.prototype.
|
79
|
-
W.prototype.fromWireType=function(a){function b(){return this.
|
74
|
+
(()=>{N("/proc",16895,0);var a=N("/proc/self",16895,0);N("/proc/self/fd",16895,0);Eb({Ha:()=>{var b=kb(a,"fd",16895,73);b.ua={lookup:(c,d)=>{var e=L[+d];if(!e)throw new J(8);c={parent:null,Ha:{rb:"fake"},ua:{readlink:()=>e.path}};return c.parent=c}};return b}},"/proc/self/fd")})();for(var fd=Array(256),gd=0;256>gd;++gd)fd[gd]=String.fromCharCode(gd);Rb=fd;Xb=g.BindingError=Wb("BindingError");Yb=g.InternalError=Wb("InternalError");
|
75
|
+
V.prototype.isAliasOf=function(a){if(!(this instanceof V&&a instanceof V))return!1;var b=this.ra.ya.wa,c=this.ra.va,d=a.ra.ya.wa;for(a=a.ra.va;b.Ca;)c=b.Ua(c),b=b.Ca;for(;d.Ca;)a=d.Ua(a),d=d.Ca;return b===d&&c===a};
|
76
|
+
V.prototype.clone=function(){this.ra.va||ac(this);if(this.ra.Ta)return this.ra.count.value+=1,this;var a=mc,b=Object,c=b.create,d=Object.getPrototypeOf(this),e=this.ra;a=a(c.call(b,d,{ra:{value:{count:e.count,Qa:e.Qa,Ta:e.Ta,va:e.va,ya:e.ya,Aa:e.Aa,Ba:e.Ba}}}));a.ra.count.value+=1;a.ra.Qa=!1;return a};V.prototype["delete"]=function(){this.ra.va||ac(this);this.ra.Qa&&!this.ra.Ta&&T("Object already scheduled for deletion");cc(this);dc(this.ra);this.ra.Ta||(this.ra.Aa=void 0,this.ra.va=void 0)};
|
77
|
+
V.prototype.isDeleted=function(){return!this.ra.va};V.prototype.deleteLater=function(){this.ra.va||ac(this);this.ra.Qa&&!this.ra.Ta&&T("Object already scheduled for deletion");gc.push(this);1===gc.length&&ic&&ic(hc);this.ra.Qa=!0;return this};g.getInheritedInstanceCount=function(){return Object.keys(jc).length};g.getLiveInheritedInstances=function(){var a=[],b;for(b in jc)jc.hasOwnProperty(b)&&a.push(jc[b]);return a};g.flushPendingDeletes=hc;g.setDelayFunction=function(a){ic=a;gc.length&&ic&&ic(hc)};
|
78
|
+
W.prototype.yb=function(a){this.tb&&(a=this.tb(a));return a};W.prototype.lb=function(a){this.Ma&&this.Ma(a)};W.prototype.argPackAdvance=8;W.prototype.readValueFromPointer=wc;W.prototype.deleteObject=function(a){if(null!==a)a["delete"]()};
|
79
|
+
W.prototype.fromWireType=function(a){function b(){return this.Wa?lc(this.wa.Ra,{ya:this.Eb,va:c,Ba:this,Aa:a}):lc(this.wa.Ra,{ya:this,va:a})}var c=this.yb(a);if(!c)return this.lb(a),null;var d=kc(this.wa,c);if(void 0!==d){if(0===d.ra.count.value)return d.ra.va=c,d.ra.Aa=a,d.clone();d=d.clone();this.lb(a);return d}d=this.wa.xb(c);d=fc[d];if(!d)return b.call(this);d=this.Va?d.vb:d.pointerType;var e=ec(c,this.wa,d.wa);return null===e?b.call(this):this.Wa?lc(d.wa.Ra,{ya:d,va:e,Ba:this,Aa:a}):lc(d.wa.Ra,
|
80
80
|
{ya:d,va:e})};zc=g.UnboundTypeError=Wb("UnboundTypeError");g.count_emval_handles=function(){for(var a=0,b=5;b<Z.length;++b)void 0!==Z[b]&&++a;return a};g.get_first_emval=function(){for(var a=5;a<Z.length;++a)if(void 0!==Z[a])return Z[a];return null};function gb(a,b){var c=Array(ta(a)+1);a=sa(a,c,0,c.length);b&&(c.length=a);return c}
|
81
|
-
var kd={a:function(a,b,c,d){x("Assertion failed: "+y(a)+", at: "+[b?y(b):"unknown filename",c,d?y(d):"unknown function"])},b:function(a){return hd(a+24)+24},d:function(a,b,c){(new Va(a)).
|
82
|
-
typeof O||!(f instanceof J))throw f;return-f.
|
83
|
-
typeof O||!(f instanceof J))throw f;return-f.
|
84
|
-
readValueFromPointer:function(k){if(1===c)var l=D;else if(2===c)l=B;else if(4===c)l=C;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(l[k>>f])},Da:null})},g:function(a,b,c,d,e,f,k,l,m,p,q,t,v){q=R(q);f=X(e,f);l&&(l=X(k,l));p&&(p=X(m,p));v=X(t,v);var h=Ub(q);oc(h,function(){Ec("Cannot construct "+q+" due to unbound types",[d])});$b([a,b,c],d?[d]:[],function(r){r=r[0];if(d){var w=r.wa;var A=w.
|
85
|
-
E)throw new Xb("Use 'new' to construct "+q);if(void 0===da.
|
86
|
-
new W(q+" const*",da,!1,!0);fc[a]={pointerType:A,
|
87
|
-
return[]})},e:function(a,b,c,d,e,f,k,l){var m=Ic(c,d);b=R(b);f=X(e,f);$b([],[a],function(p){function q(){Ec("Cannot call "+t+" due to unbound types",m)}p=p[0];var t=p.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);l&&p.wa.
|
81
|
+
var kd={a:function(a,b,c,d){x("Assertion failed: "+y(a)+", at: "+[b?y(b):"unknown filename",c,d?y(d):"unknown function"])},b:function(a){return hd(a+24)+24},d:function(a,b,c){(new Va(a)).Ia(b,c);Wa++;throw a;},u:function(a,b,c){Pb=c;try{var d=Q(a);switch(b){case 0:var e=P();return 0>e?-28:Db(d,e).fd;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=P(),d.flags|=e,0;case 5:return e=P(),B[e+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return C[jd()>>2]=28,-1;default:return-28}}catch(f){if("undefined"==
|
82
|
+
typeof O||!(f instanceof J))throw f;return-f.Ja}},H:function(a,b,c){Pb=c;try{var d=Q(a);switch(b){case 21509:case 21505:return d.tty?0:-59;case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:return d.tty?0:-59;case 21519:if(!d.tty)return-59;var e=P();return C[e>>2]=0;case 21520:return d.tty?-28:-59;case 21531:a=e=P();if(!d.sa.Ab)throw new J(59);return d.sa.Ab(d,b,a);case 21523:return d.tty?0:-59;case 21524:return d.tty?0:-59;default:x("bad ioctl syscall "+b)}}catch(f){if("undefined"==
|
83
|
+
typeof O||!(f instanceof J))throw f;return-f.Ja}},t:function(a,b,c,d){Pb=d;try{b=y(b);var e=b;if("/"===e.charAt(0))b=e;else{if(-100===a)var f="/";else{var k=L[a];if(!k)throw new J(8);f=k.path}if(0==e.length)throw new J(44);b=Ya(f+"/"+e)}var l=d?P():0;return Ib(b,c,l).fd}catch(m){if("undefined"==typeof O||!(m instanceof J))throw m;return-m.Ja}},C:function(){},N:function(a,b,c,d,e){var f=Qb(c);b=R(b);U(a,{name:b,fromWireType:function(k){return!!k},toWireType:function(k,l){return l?d:e},argPackAdvance:8,
|
84
|
+
readValueFromPointer:function(k){if(1===c)var l=D;else if(2===c)l=B;else if(4===c)l=C;else throw new TypeError("Unknown boolean type size: "+b);return this.fromWireType(l[k>>f])},Da:null})},g:function(a,b,c,d,e,f,k,l,m,p,q,t,v){q=R(q);f=X(e,f);l&&(l=X(k,l));p&&(p=X(m,p));v=X(t,v);var h=Ub(q);oc(h,function(){Ec("Cannot construct "+q+" due to unbound types",[d])});$b([a,b,c],d?[d]:[],function(r){r=r[0];if(d){var w=r.wa;var A=w.Ra}else A=V.prototype;r=Vb(h,function(){if(Object.getPrototypeOf(this)!==
|
85
|
+
E)throw new Xb("Use 'new' to construct "+q);if(void 0===da.Ia)throw new Xb(q+" has no accessible constructor");var Cc=da.Ia[arguments.length];if(void 0===Cc)throw new Xb("Tried to invoke ctor of "+q+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(da.Ia).toString()+") parameters instead!");return Cc.apply(this,arguments)});var E=Object.create(A,{constructor:{value:r}});r.prototype=E;var da=new pc(q,r,E,v,w,f,l,p);w=new W(q,da,!0,!1);A=new W(q+"*",da,!1,!1);var Dc=
|
86
|
+
new W(q+" const*",da,!1,!0);fc[a]={pointerType:A,vb:Dc};xc(h,r);return[w,A,Dc]})},f:function(a,b,c,d,e,f,k){var l=Ic(c,d);b=R(b);f=X(e,f);$b([],[a],function(m){function p(){Ec("Cannot call "+q+" due to unbound types",l)}m=m[0];var q=m.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);var t=m.wa.constructor;void 0===t[b]?(p.Pa=c-1,t[b]=p):(nc(t,b,q),t[b].za[c-1]=p);$b([],l,function(v){v=[v[0],null].concat(v.slice(1));v=Hc(q,v,null,f,k);void 0===t[b].za?(v.Pa=c-1,t[b]=v):t[b].za[c-1]=v;return[]});
|
87
|
+
return[]})},e:function(a,b,c,d,e,f,k,l){var m=Ic(c,d);b=R(b);f=X(e,f);$b([],[a],function(p){function q(){Ec("Cannot call "+t+" due to unbound types",m)}p=p[0];var t=p.name+"."+b;b.startsWith("@@")&&(b=Symbol[b.substring(2)]);l&&p.wa.Fb.push(b);var v=p.wa.Ra,h=v[b];void 0===h||void 0===h.za&&h.className!==p.name&&h.Pa===c-2?(q.Pa=c-2,q.className=p.name,v[b]=q):(nc(v,b,t),v[b].za[c-2]=q);$b([],m,function(r){r=Hc(t,r,p,f,k);void 0===v[b].za?(r.Pa=c-2,v[b]=r):v[b].za[c-2]=r;return[]});return[]})},M:function(a,
|
88
88
|
b){b=R(b);U(a,{name:b,fromWireType:function(c){var d=Lc(c);Kc(c);return d},toWireType:function(c,d){return uc(d)},argPackAdvance:8,readValueFromPointer:wc,Da:null})},j:function(a,b,c,d){function e(){}c=Qb(c);b=R(b);e.values={};U(a,{name:b,constructor:e,fromWireType:function(f){return this.constructor.values[f]},toWireType:function(f,k){return k.value},argPackAdvance:8,readValueFromPointer:Mc(b,c,d),Da:null});oc(b,e)},c:function(a,b,c){var d=Nc(a,"enum");b=R(b);a=d.constructor;d=Object.create(d.constructor.prototype,
|
89
89
|
{value:{value:c},constructor:{value:Vb(d.name+"_"+b,function(){})}});a.values[c]=d;a[b]=d},x:function(a,b,c){c=Qb(c);b=R(b);U(a,{name:b,fromWireType:function(d){return d},toWireType:function(d,e){return e},argPackAdvance:8,readValueFromPointer:Oc(b,c),Da:null})},q:function(a,b,c,d,e,f){var k=Ic(b,c);a=R(a);e=X(d,e);oc(a,function(){Ec("Cannot call "+a+" due to unbound types",k)},b-1);$b([],k,function(l){l=[l[0],null].concat(l.slice(1));xc(a,Hc(a,l,null,e,f),b-1);return[]})},l:function(a,b,c,d,e){b=
|
90
90
|
R(b);-1===e&&(e=4294967295);e=Qb(c);var f=l=>l;if(0===d){var k=32-8*c;f=l=>l<<k>>>k}c=b.includes("unsigned")?function(l,m){return m>>>0}:function(l,m){return m};U(a,{name:b,fromWireType:f,toWireType:c,argPackAdvance:8,readValueFromPointer:Pc(b,e,0!==d),Da:null})},h:function(a,b,c){function d(f){f>>=2;var k=F;return new e(Ca,k[f+1],k[f])}var e=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][b];c=R(c);U(a,{name:c,fromWireType:d,argPackAdvance:8,readValueFromPointer:d},
|
91
|
-
{
|
91
|
+
{zb:!0})},w:function(a,b){b=R(b);var c="std::string"===b;U(a,{name:b,fromWireType:function(d){var e=F[d>>2];if(c)for(var f=d+4,k=0;k<=e;++k){var l=d+4+k;if(k==e||0==z[l]){f=y(f,l-f);if(void 0===m)var m=f;else m+=String.fromCharCode(0),m+=f;f=l+1}}else{m=Array(e);for(k=0;k<e;++k)m[k]=String.fromCharCode(z[d+4+k]);m=m.join("")}Y(d);return m},toWireType:function(d,e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var f="string"==typeof e;f||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof
|
92
92
|
Int8Array||T("Cannot pass non-string to std::string");var k=(c&&f?()=>ta(e):()=>e.length)(),l=hd(4+k+1);F[l>>2]=k;if(c&&f)sa(e,z,l+4,k+1);else if(f)for(f=0;f<k;++f){var m=e.charCodeAt(f);255<m&&(Y(l),T("String has UTF-16 code units that do not fit in 8 bits"));z[l+4+f]=m}else for(f=0;f<k;++f)z[l+4+f]=e[f];null!==d&&d.push(Y,l);return l},argPackAdvance:8,readValueFromPointer:wc,Da:function(d){Y(d)}})},p:function(a,b,c){c=R(c);if(2===b){var d=va;var e=xa;var f=ya;var k=()=>wa;var l=1}else 4===b&&(d=
|
93
|
-
za,e=Aa,f=Ba,k=()=>F,l=2);U(a,{name:c,fromWireType:function(m){for(var p=F[m>>2],q=k(),t,v=m+4,h=0;h<=p;++h){var r=m+4+h*b;if(h==p||0==q[r>>l])v=d(v,r-v),void 0===t?t=v:(t+=String.fromCharCode(0),t+=v),v=r+b}Y(m);return t},toWireType:function(m,p){"string"!=typeof p&&T("Cannot pass non-string to C++ string type "+c);var q=f(p),t=hd(4+q+b);F[t>>2]=q>>l;e(p,t+4,q+b);null!==m&&m.push(Y,t);return t},argPackAdvance:8,readValueFromPointer:wc,Da:function(m){Y(m)}})},O:function(a,b){b=R(b);U(a,{
|
93
|
+
za,e=Aa,f=Ba,k=()=>F,l=2);U(a,{name:c,fromWireType:function(m){for(var p=F[m>>2],q=k(),t,v=m+4,h=0;h<=p;++h){var r=m+4+h*b;if(h==p||0==q[r>>l])v=d(v,r-v),void 0===t?t=v:(t+=String.fromCharCode(0),t+=v),v=r+b}Y(m);return t},toWireType:function(m,p){"string"!=typeof p&&T("Cannot pass non-string to C++ string type "+c);var q=f(p),t=hd(4+q+b);F[t>>2]=q>>l;e(p,t+4,q+b);null!==m&&m.push(Y,t);return t},argPackAdvance:8,readValueFromPointer:wc,Da:function(m){Y(m)}})},O:function(a,b){b=R(b);U(a,{Bb:!0,name:b,
|
94
94
|
argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},v:function(){return Date.now()},K:function(){return!0},P:function(a,b,c,d){a=Sc[a];b=Lc(b);c=Rc(c);a(b,c,null,d)},i:Kc,z:function(a){if(0===a)return uc(Tc());a=Rc(a);return uc(Tc()[a])},Q:function(a,b){var c=Vc(a,b),d=c[0];b=d.name+"_$"+c.slice(1).map(function(q){return q.name}).join("_")+"$";var e=Wc[b];if(void 0!==e)return e;e=["retType"];for(var f=[d],k="",l=0;l<a-1;++l)k+=(0!==l?", ":"")+"arg"+l,e.push("argType"+l),f.push(c[1+
|
95
|
-
l]);var m="return function "+Ub("methodCaller_"+b)+"(handle, name, destructors, args) {\n",p=0;for(l=0;l<a-1;++l)m+=" var arg"+l+" = argType"+l+".readValueFromPointer(args"+(p?"+"+p:"")+");\n",p+=c[l+1].argPackAdvance;m+=" var rv = handle[name]("+k+");\n";for(l=0;l<a-1;++l)c[l+1].deleteObject&&(m+=" argType"+l+".deleteObject(arg"+l+");\n");d.
|
95
|
+
l]);var m="return function "+Ub("methodCaller_"+b)+"(handle, name, destructors, args) {\n",p=0;for(l=0;l<a-1;++l)m+=" var arg"+l+" = argType"+l+".readValueFromPointer(args"+(p?"+"+p:"")+");\n",p+=c[l+1].argPackAdvance;m+=" var rv = handle[name]("+k+");\n";for(l=0;l<a-1;++l)c[l+1].deleteObject&&(m+=" argType"+l+".deleteObject(arg"+l+");\n");d.Bb||(m+=" return retType.toWireType(destructors, rv);\n");e.push(m+"};\n");a=Fc(e).apply(null,f);e=Uc(a);return Wc[b]=e},k:function(a){4<a&&(Z[a].hb+=
|
96
96
|
1)},y:function(a,b,c,d){a=Lc(a);var e=Xc[b];if(!e){e="";for(var f=0;f<b;++f)e+=(0!==f?", ":"")+"arg"+f;var k="return function emval_allocator_"+b+"(constructor, argTypes, args) {\n";for(f=0;f<b;++f)k+="var argType"+f+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+f+'], "parameter '+f+'");\nvar arg'+f+" = argType"+f+".readValueFromPointer(args);\nargs += argType"+f+"['argPackAdvance'];\n";e=(new Function("requireRegisteredType","Module","valueToHandle",k+("var obj = new constructor("+
|
97
|
-
e+");\nreturn valueToHandle(obj);\n}\n")))(Nc,g,uc);Xc[b]=e}return e(a,c,d)},A:function(a,b){a=Nc(a,"_emval_take_value");a=a.readValueFromPointer(b);return uc(a)},J:function(a,b,c,d,e,f){try{var k=L[e];if(k&&c&2){var l=z.slice(a,a+b);k&&k.sa.
|
97
|
+
e+");\nreturn valueToHandle(obj);\n}\n")))(Nc,g,uc);Xc[b]=e}return e(a,c,d)},A:function(a,b){a=Nc(a,"_emval_take_value");a=a.readValueFromPointer(b);return uc(a)},J:function(a,b,c,d,e,f){try{var k=L[e];if(k&&c&2){var l=z.slice(a,a+b);k&&k.sa.Za&&k.sa.Za(k,l,f,b,d)}}catch(m){if("undefined"==typeof O||!(m instanceof J))throw m;return-m.Ja}},n:function(){x("")},L:function(a,b,c){z.copyWithin(a,b,b+c)},I:function(a){var b=z.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);
|
98
98
|
d=Math.min(d,a+100663296);var e=Math;d=Math.max(a,d);e=e.min.call(e,2147483648,d+(65536-d%65536)%65536);a:{try{oa.grow(e-Ca.byteLength+65535>>>16);Fa();var f=1;break a}catch(k){}f=void 0}if(f)return!0}return!1},F:function(a,b){var c=0;Zc().forEach(function(d,e){var f=b+c;e=F[a+4*e>>2]=f;for(f=0;f<d.length;++f)D[e++>>0]=d.charCodeAt(f);D[e>>0]=0;c+=d.length+1});return 0},G:function(a,b){var c=Zc();F[a>>2]=c.length;var d=0;c.forEach(function(e){d+=e.length+1});F[b>>2]=d;return 0},o:function(a){try{var b=
|
99
|
-
Q(a);if(null===b.fd)throw new J(8);b.
|
100
|
-
var h="undefined"!=typeof t;if(!h)t=m.position;else if(!m.seekable)throw new J(70);var r=m.sa.read(m,v,p,q,t);h||(m.position+=r);var w=r;if(0>w){var A=-1;break a}b+=w;if(w<l)break}A=b}C[d>>2]=A;return 0}catch(E){if("undefined"==typeof O||!(E instanceof J))throw E;return E.
|
101
|
-
0)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];C[e>>2]=Ra[0];C[e+4>>2]=Ra[1];f.
|
102
|
-
m.seekable&&m.flags&1024&&Jb(m,0,2);var h="undefined"!=typeof t;if(!h)t=m.position;else if(!m.seekable)throw new J(70);var r=m.sa.write(m,v,p,q,t,void 0);h||(m.position+=r);var w=r;if(0>w){var A=-1;break a}b+=w}A=b}F[d>>2]=A;return 0}catch(E){if("undefined"==typeof O||!(E instanceof J))throw E;return E.
|
99
|
+
Q(a);if(null===b.fd)throw new J(8);b.cb&&(b.cb=null);try{b.sa.close&&b.sa.close(b)}catch(c){throw c;}finally{L[b.fd]=null}b.fd=null;return 0}catch(c){if("undefined"==typeof O||!(c instanceof J))throw c;return c.Ja}},s:function(a,b,c,d){try{a:{var e=Q(a);a=b;for(var f=b=0;f<c;f++){var k=F[a>>2],l=F[a+4>>2];a+=8;var m=e,p=k,q=l,t=void 0,v=D;if(0>q||0>t)throw new J(28);if(null===m.fd)throw new J(8);if(1===(m.flags&2097155))throw new J(8);if(16384===(m.node.mode&61440))throw new J(31);if(!m.sa.read)throw new J(28);
|
100
|
+
var h="undefined"!=typeof t;if(!h)t=m.position;else if(!m.seekable)throw new J(70);var r=m.sa.read(m,v,p,q,t);h||(m.position+=r);var w=r;if(0>w){var A=-1;break a}b+=w;if(w<l)break}A=b}C[d>>2]=A;return 0}catch(E){if("undefined"==typeof O||!(E instanceof J))throw E;return E.Ja}},B:function(a,b,c,d,e){try{b=c+2097152>>>0<4194305-!!b?(b>>>0)+4294967296*c:NaN;if(isNaN(b))return 61;var f=Q(a);Jb(f,b,d);Ra=[f.position>>>0,(I=f.position,1<=+Math.abs(I)?0<I?(Math.min(+Math.floor(I/4294967296),4294967295)|
|
101
|
+
0)>>>0:~~+Math.ceil((I-+(~~I>>>0))/4294967296)>>>0:0)];C[e>>2]=Ra[0];C[e+4>>2]=Ra[1];f.cb&&0===b&&0===d&&(f.cb=null);return 0}catch(k){if("undefined"==typeof O||!(k instanceof J))throw k;return k.Ja}},r:function(a,b,c,d){try{a:{var e=Q(a);a=b;for(var f=b=0;f<c;f++){var k=F[a>>2],l=F[a+4>>2];a+=8;var m=e,p=k,q=l,t=void 0,v=D;if(0>q||0>t)throw new J(28);if(null===m.fd)throw new J(8);if(0===(m.flags&2097155))throw new J(8);if(16384===(m.node.mode&61440))throw new J(31);if(!m.sa.write)throw new J(28);
|
102
|
+
m.seekable&&m.flags&1024&&Jb(m,0,2);var h="undefined"!=typeof t;if(!h)t=m.position;else if(!m.seekable)throw new J(70);var r=m.sa.write(m,v,p,q,t,void 0);h||(m.position+=r);var w=r;if(0>w){var A=-1;break a}b+=w}A=b}F[d>>2]=A;return 0}catch(E){if("undefined"==typeof O||!(E instanceof J))throw E;return E.Ja}},D:ad,m:function(){},E:function(a,b,c,d){return ed(a,b,c,d)}};
|
103
103
|
(function(){function a(e){g.asm=e.exports;oa=g.asm.R;Fa();Ga=g.asm.T;Ia.unshift(g.asm.S);G--;g.monitorRunDependencies&&g.monitorRunDependencies(G);0==G&&(null!==La&&(clearInterval(La),La=null),Ma&&(e=Ma,Ma=null,e()))}function b(e){a(e.instance)}function c(e){return Qa().then(function(f){return WebAssembly.instantiate(f,d)}).then(function(f){return f}).then(e,function(f){u("failed to asynchronously prepare wasm: "+f);x(f)})}var d={a:kd};G++;g.monitorRunDependencies&&g.monitorRunDependencies(G);if(g.instantiateWasm)try{return g.instantiateWasm(d,
|
104
104
|
a)}catch(e){return u("Module.instantiateWasm callback failed with error: "+e),!1}(function(){return na||"function"!=typeof WebAssembly.instantiateStreaming||Na()||H.startsWith("file://")||fa||"function"!=typeof fetch?c(b):fetch(H,{credentials:"same-origin"}).then(function(e){return WebAssembly.instantiateStreaming(e,d).then(b,function(f){u("wasm streaming compile failed: "+f);u("falling back to ArrayBuffer instantiation");return c(b)})})})();return{}})();
|
105
105
|
g.___wasm_call_ctors=function(){return(g.___wasm_call_ctors=g.asm.S).apply(null,arguments)};var Y=g._free=function(){return(Y=g._free=g.asm.U).apply(null,arguments)},hd=g._malloc=function(){return(hd=g._malloc=g.asm.V).apply(null,arguments)},jd=g.___errno_location=function(){return(jd=g.___errno_location=g.asm.W).apply(null,arguments)},Bc=g.___getTypeName=function(){return(Bc=g.___getTypeName=g.asm.X).apply(null,arguments)};
|
Binary file
|
package/package.json
CHANGED
@@ -1,17 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "@trustwallet/wallet-core",
|
3
|
-
"version": "2.9.
|
3
|
+
"version": "2.9.6",
|
4
4
|
"description": "wallet core wasm and protobuf models",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
7
7
|
"scripts": {
|
8
|
-
"test": "mocha
|
8
|
+
"test": "mocha",
|
9
9
|
"generate": "npm run codegen:js && npm run codegen:ts",
|
10
10
|
"codegen:js": "pbjs -t static-module '../src/proto/*.proto' --no-delimited --force-long -o generated/core_proto.js",
|
11
|
+
"codegen:js-browser": "pbjs -t static-module '../src/proto/*.proto' -w closure --no-delimited --force-long -o ../samples/wasm/core_proto.js",
|
11
12
|
"codegen:ts": "pbts -o generated/core_proto.d.ts generated/core_proto.js",
|
12
13
|
"clean": "rm -rf dist generated && mkdir -p dist/generated generated",
|
13
|
-
"build": "npm run clean && npm run generate && cp -R generated lib dist && tsc
|
14
|
-
"copy:wasm": "mkdir -p lib && cp ../wasm-build/wasm/wallet-core.* lib"
|
14
|
+
"build": "npm run clean && npm run generate && cp -R generated lib dist && tsc",
|
15
|
+
"copy:wasm": "mkdir -p lib && cp ../wasm-build/wasm/wallet-core.* lib",
|
16
|
+
"copy:wasm-sample": "cp ../wasm-build/wasm/wallet-core.* ../samples/wasm/"
|
15
17
|
},
|
16
18
|
"repository": {
|
17
19
|
"type": "git",
|