ccxt 4.4.77 → 4.4.80
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/README.md +8 -10
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +8 -4
- package/dist/cjs/src/abstract/ace.js +1 -1
- package/dist/cjs/src/abstract/apex.js +9 -0
- package/dist/cjs/src/ace.js +1 -1
- package/dist/cjs/src/apex.js +1949 -0
- package/dist/cjs/src/ascendex.js +25 -4
- package/dist/cjs/src/base/Exchange.js +42 -2
- package/dist/cjs/src/binance.js +9 -1
- package/dist/cjs/src/bingx.js +3 -3
- package/dist/cjs/src/bitfinex.js +64 -36
- package/dist/cjs/src/bitget.js +191 -138
- package/dist/cjs/src/bitmart.js +7 -2
- package/dist/cjs/src/bitmex.js +16 -8
- package/dist/cjs/src/bitopro.js +5 -1
- package/dist/cjs/src/bitrue.js +2 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitteam.js +2 -0
- package/dist/cjs/src/bitvavo.js +28 -10
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/btcmarkets.js +1 -1
- package/dist/cjs/src/btcturk.js +1 -1
- package/dist/cjs/src/bybit.js +32 -16
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +18 -2
- package/dist/cjs/src/coincatch.js +68 -0
- package/dist/cjs/src/coinex.js +1 -0
- package/dist/cjs/src/coinlist.js +1 -0
- package/dist/cjs/src/coinone.js +1 -0
- package/dist/cjs/src/delta.js +4 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/hitbtc.js +3 -0
- package/dist/cjs/src/hollaex.js +1 -0
- package/dist/cjs/src/htx.js +7 -3
- package/dist/cjs/src/huobijp.js +1 -0
- package/dist/cjs/src/hyperliquid.js +14 -4
- package/dist/cjs/src/kraken.js +2 -0
- package/dist/cjs/src/mexc.js +50 -57
- package/dist/cjs/src/okx.js +1 -1
- package/dist/cjs/src/phemex.js +2 -1
- package/dist/cjs/src/poloniex.js +2 -1
- package/dist/cjs/src/pro/apex.js +1043 -0
- package/dist/cjs/src/pro/binance.js +3 -3
- package/dist/cjs/src/pro/coinbase.js +45 -68
- package/dist/cjs/src/pro/gate.js +27 -2
- package/dist/cjs/src/pro/hollaex.js +2 -2
- package/dist/cjs/src/pro/p2b.js +2 -2
- package/dist/cjs/src/pro/tradeogre.js +283 -0
- package/dist/cjs/src/pro/upbit.js +43 -0
- package/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2639 -0
- package/dist/cjs/src/timex.js +2 -2
- package/dist/cjs/src/tradeogre.js +2 -1
- package/dist/cjs/src/upbit.js +277 -67
- package/dist/cjs/src/whitebit.js +66 -12
- package/dist/cjs/src/woo.js +3 -1
- package/dist/cjs/src/xt.js +9 -0
- package/js/ccxt.d.ts +11 -5
- package/js/ccxt.js +8 -4
- package/js/src/abstract/apex.d.ts +34 -0
- package/js/src/abstract/bitmart.d.ts +1 -0
- package/js/src/apex.d.ts +333 -0
- package/js/src/apex.js +1945 -0
- package/js/src/ascendex.d.ts +3 -3
- package/js/src/ascendex.js +25 -4
- package/js/src/base/Exchange.d.ts +2 -0
- package/js/src/base/Exchange.js +42 -1
- package/js/src/binance.d.ts +7 -7
- package/js/src/binance.js +9 -1
- package/js/src/bingx.js +3 -3
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex.js +64 -36
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitget.d.ts +2 -0
- package/js/src/bitget.js +191 -138
- package/js/src/bitmart.d.ts +5 -4
- package/js/src/bitmart.js +7 -2
- package/js/src/bitmex.d.ts +3 -3
- package/js/src/bitmex.js +16 -8
- package/js/src/bitopro.js +5 -1
- package/js/src/bitrue.js +2 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitteam.js +2 -0
- package/js/src/bitvavo.js +28 -10
- package/js/src/btcalpha.js +1 -1
- package/js/src/btcmarkets.js +1 -1
- package/js/src/btcturk.js +1 -1
- package/js/src/bybit.js +32 -16
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +4 -4
- package/js/src/coinbase.js +18 -2
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coincatch.d.ts +11 -0
- package/js/src/coincatch.js +68 -0
- package/js/src/coinex.js +1 -0
- package/js/src/coinlist.js +1 -0
- package/js/src/coinone.js +1 -0
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/delta.js +4 -0
- package/js/src/deribit.d.ts +4 -4
- package/js/src/deribit.js +1 -0
- package/js/src/derive.d.ts +3 -3
- package/js/src/digifinex.d.ts +4 -4
- package/js/src/hitbtc.js +3 -0
- package/js/src/hollaex.js +1 -0
- package/js/src/htx.d.ts +4 -4
- package/js/src/htx.js +7 -3
- package/js/src/huobijp.js +1 -0
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +14 -4
- package/js/src/kraken.d.ts +3 -3
- package/js/src/kraken.js +2 -0
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/kucoinfutures.d.ts +5 -5
- package/js/src/mexc.d.ts +1 -0
- package/js/src/mexc.js +50 -57
- package/js/src/okx.js +1 -1
- package/js/src/oxfun.d.ts +3 -3
- package/js/src/phemex.d.ts +3 -3
- package/js/src/phemex.js +2 -1
- package/js/src/poloniex.d.ts +3 -3
- package/js/src/poloniex.js +2 -1
- package/js/src/pro/apex.d.ts +160 -0
- package/js/src/pro/apex.js +1038 -0
- package/js/src/pro/binance.js +3 -3
- package/js/src/pro/coinbase.d.ts +4 -3
- package/js/src/pro/coinbase.js +45 -66
- package/js/src/pro/gate.js +27 -2
- package/js/src/pro/hollaex.js +2 -2
- package/js/src/pro/p2b.js +2 -2
- package/js/src/pro/tradeogre.d.ts +49 -0
- package/js/src/pro/tradeogre.js +278 -0
- package/js/src/pro/upbit.d.ts +16 -1
- package/js/src/pro/upbit.js +43 -0
- package/js/src/probit.js +1 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.d.ts +1279 -0
- package/js/src/static_dependencies/zklink/zklink-sdk-web.js +4276 -0
- package/js/src/timex.js +2 -2
- package/js/src/tradeogre.js +2 -1
- package/js/src/upbit.d.ts +75 -23
- package/js/src/upbit.js +277 -67
- package/js/src/vertex.d.ts +3 -3
- package/js/src/whitebit.js +66 -12
- package/js/src/woo.d.ts +4 -4
- package/js/src/woo.js +3 -1
- package/js/src/woofipro.d.ts +4 -4
- package/js/src/xt.d.ts +4 -4
- package/js/src/xt.js +9 -0
- package/package.json +2 -2
- package/js/src/abstract/ace.d.ts +0 -18
- package/js/src/ace.d.ts +0 -158
- package/js/src/ace.js +0 -1175
- /package/js/src/abstract/{ace.js → apex.js} +0 -0
|
@@ -0,0 +1,4276 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
const heap = new Array(128).fill(undefined);
|
|
3
|
+
heap.push(undefined, null, true, false);
|
|
4
|
+
function getObject(idx) {
|
|
5
|
+
return heap[idx];
|
|
6
|
+
}
|
|
7
|
+
let heap_next = heap.length;
|
|
8
|
+
function dropObject(idx) {
|
|
9
|
+
if (idx < 132)
|
|
10
|
+
return;
|
|
11
|
+
heap[idx] = heap_next;
|
|
12
|
+
heap_next = idx;
|
|
13
|
+
}
|
|
14
|
+
function takeObject(idx) {
|
|
15
|
+
const ret = getObject(idx);
|
|
16
|
+
dropObject(idx);
|
|
17
|
+
return ret;
|
|
18
|
+
}
|
|
19
|
+
function addHeapObject(obj) {
|
|
20
|
+
if (heap_next === heap.length)
|
|
21
|
+
heap.push(heap.length + 1);
|
|
22
|
+
const idx = heap_next;
|
|
23
|
+
heap_next = heap[idx];
|
|
24
|
+
heap[idx] = obj;
|
|
25
|
+
return idx;
|
|
26
|
+
}
|
|
27
|
+
const cachedTextDecoder = typeof TextDecoder !== 'undefined'
|
|
28
|
+
? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true })
|
|
29
|
+
: {
|
|
30
|
+
decode: () => {
|
|
31
|
+
throw Error('TextDecoder not available');
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
if (typeof TextDecoder !== 'undefined') {
|
|
35
|
+
cachedTextDecoder.decode();
|
|
36
|
+
}
|
|
37
|
+
let cachedUint8Memory0 = null;
|
|
38
|
+
function getUint8Memory0() {
|
|
39
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
40
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
41
|
+
}
|
|
42
|
+
return cachedUint8Memory0;
|
|
43
|
+
}
|
|
44
|
+
function getStringFromWasm0(ptr, len) {
|
|
45
|
+
ptr = ptr >>> 0;
|
|
46
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
47
|
+
}
|
|
48
|
+
function isLikeNone(x) {
|
|
49
|
+
return x === undefined || x === null;
|
|
50
|
+
}
|
|
51
|
+
let cachedFloat64Memory0 = null;
|
|
52
|
+
function getFloat64Memory0() {
|
|
53
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
54
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
55
|
+
}
|
|
56
|
+
return cachedFloat64Memory0;
|
|
57
|
+
}
|
|
58
|
+
let cachedInt32Memory0 = null;
|
|
59
|
+
function getInt32Memory0() {
|
|
60
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
61
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
62
|
+
}
|
|
63
|
+
return cachedInt32Memory0;
|
|
64
|
+
}
|
|
65
|
+
let WASM_VECTOR_LEN = 0;
|
|
66
|
+
const cachedTextEncoder = typeof TextEncoder !== 'undefined'
|
|
67
|
+
? new TextEncoder('utf-8')
|
|
68
|
+
: {
|
|
69
|
+
encode: () => {
|
|
70
|
+
throw Error('TextEncoder not available');
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
const encodeString = typeof cachedTextEncoder.encodeInto === 'function'
|
|
74
|
+
? function (arg, view) {
|
|
75
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
76
|
+
}
|
|
77
|
+
: function (arg, view) {
|
|
78
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
79
|
+
view.set(buf);
|
|
80
|
+
return {
|
|
81
|
+
read: arg.length,
|
|
82
|
+
written: buf.length,
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
86
|
+
if (realloc === undefined) {
|
|
87
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
88
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
89
|
+
getUint8Memory0()
|
|
90
|
+
.subarray(ptr, ptr + buf.length)
|
|
91
|
+
.set(buf);
|
|
92
|
+
WASM_VECTOR_LEN = buf.length;
|
|
93
|
+
return ptr;
|
|
94
|
+
}
|
|
95
|
+
let len = arg.length;
|
|
96
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
97
|
+
const mem = getUint8Memory0();
|
|
98
|
+
let offset = 0;
|
|
99
|
+
for (; offset < len; offset++) {
|
|
100
|
+
const code = arg.charCodeAt(offset);
|
|
101
|
+
if (code > 0x7f)
|
|
102
|
+
break;
|
|
103
|
+
mem[ptr + offset] = code;
|
|
104
|
+
}
|
|
105
|
+
if (offset !== len) {
|
|
106
|
+
if (offset !== 0) {
|
|
107
|
+
arg = arg.slice(offset);
|
|
108
|
+
}
|
|
109
|
+
ptr = realloc(ptr, len, (len = offset + arg.length * 3), 1) >>> 0;
|
|
110
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
111
|
+
const ret = encodeString(arg, view);
|
|
112
|
+
offset += ret.written;
|
|
113
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
114
|
+
}
|
|
115
|
+
WASM_VECTOR_LEN = offset;
|
|
116
|
+
return ptr;
|
|
117
|
+
}
|
|
118
|
+
let cachedBigInt64Memory0 = null;
|
|
119
|
+
function getBigInt64Memory0() {
|
|
120
|
+
if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
|
|
121
|
+
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
|
|
122
|
+
}
|
|
123
|
+
return cachedBigInt64Memory0;
|
|
124
|
+
}
|
|
125
|
+
function debugString(val) {
|
|
126
|
+
// primitive types
|
|
127
|
+
const type = typeof val;
|
|
128
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
129
|
+
return `${val}`;
|
|
130
|
+
}
|
|
131
|
+
if (type == 'string') {
|
|
132
|
+
return `"${val}"`;
|
|
133
|
+
}
|
|
134
|
+
if (type == 'symbol') {
|
|
135
|
+
const description = val.description;
|
|
136
|
+
if (description == null) {
|
|
137
|
+
return 'Symbol';
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return `Symbol(${description})`;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
if (type == 'function') {
|
|
144
|
+
const name = val.name;
|
|
145
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
146
|
+
return `Function(${name})`;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
return 'Function';
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
// objects
|
|
153
|
+
if (Array.isArray(val)) {
|
|
154
|
+
const length = val.length;
|
|
155
|
+
let debug = '[';
|
|
156
|
+
if (length > 0) {
|
|
157
|
+
debug += debugString(val[0]);
|
|
158
|
+
}
|
|
159
|
+
for (let i = 1; i < length; i++) {
|
|
160
|
+
debug += ', ' + debugString(val[i]);
|
|
161
|
+
}
|
|
162
|
+
debug += ']';
|
|
163
|
+
return debug;
|
|
164
|
+
}
|
|
165
|
+
// Test for built-in
|
|
166
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
167
|
+
let className;
|
|
168
|
+
if (builtInMatches.length > 1) {
|
|
169
|
+
className = builtInMatches[1];
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
// Failed to match the standard '[object ClassName]'
|
|
173
|
+
return toString.call(val);
|
|
174
|
+
}
|
|
175
|
+
if (className == 'Object') {
|
|
176
|
+
// we're a user defined class or Object
|
|
177
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
178
|
+
// easier than looping through ownProperties of `val`.
|
|
179
|
+
try {
|
|
180
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
181
|
+
}
|
|
182
|
+
catch (_) {
|
|
183
|
+
return 'Object';
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// errors
|
|
187
|
+
if (val instanceof Error) {
|
|
188
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
189
|
+
}
|
|
190
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
191
|
+
return className;
|
|
192
|
+
}
|
|
193
|
+
const CLOSURE_DTORS = typeof FinalizationRegistry === 'undefined'
|
|
194
|
+
? { register: () => { }, unregister: () => { } }
|
|
195
|
+
: new FinalizationRegistry(state => {
|
|
196
|
+
wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
|
|
197
|
+
});
|
|
198
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
199
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
200
|
+
const real = (...args) => {
|
|
201
|
+
// First up with a closure we increment the internal reference
|
|
202
|
+
// count. This ensures that the Rust closure environment won't
|
|
203
|
+
// be deallocated while we're invoking it.
|
|
204
|
+
state.cnt++;
|
|
205
|
+
const a = state.a;
|
|
206
|
+
state.a = 0;
|
|
207
|
+
try {
|
|
208
|
+
return f(a, state.b, ...args);
|
|
209
|
+
}
|
|
210
|
+
finally {
|
|
211
|
+
if (--state.cnt === 0) {
|
|
212
|
+
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
213
|
+
CLOSURE_DTORS.unregister(state);
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
state.a = a;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
real.original = state;
|
|
221
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
222
|
+
return real;
|
|
223
|
+
}
|
|
224
|
+
function __wbg_adapter_50(arg0, arg1) {
|
|
225
|
+
wasm.__wbindgen_export_3(arg0, arg1);
|
|
226
|
+
}
|
|
227
|
+
function __wbg_adapter_53(arg0, arg1, arg2) {
|
|
228
|
+
wasm.__wbindgen_export_4(arg0, arg1, addHeapObject(arg2));
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @param {any} provider
|
|
232
|
+
* @returns {JsonRpcSigner}
|
|
233
|
+
*/
|
|
234
|
+
export function newRpcSignerWithProvider(provider) {
|
|
235
|
+
try {
|
|
236
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
237
|
+
wasm.newRpcSignerWithProvider(retptr, addHeapObject(provider));
|
|
238
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
239
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
240
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
241
|
+
if (r2) {
|
|
242
|
+
throw takeObject(r1);
|
|
243
|
+
}
|
|
244
|
+
return JsonRpcSigner.__wrap(r0);
|
|
245
|
+
}
|
|
246
|
+
finally {
|
|
247
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* @param {any} signer
|
|
252
|
+
* @param {string} pub_key
|
|
253
|
+
* @param {string} chain_id
|
|
254
|
+
* @returns {JsonRpcSigner}
|
|
255
|
+
*/
|
|
256
|
+
export function newRpcSignerWithSigner(signer, pub_key, chain_id) {
|
|
257
|
+
try {
|
|
258
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
259
|
+
const ptr0 = passStringToWasm0(pub_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
260
|
+
const len0 = WASM_VECTOR_LEN;
|
|
261
|
+
const ptr1 = passStringToWasm0(chain_id, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
262
|
+
const len1 = WASM_VECTOR_LEN;
|
|
263
|
+
wasm.newRpcSignerWithSigner(retptr, addHeapObject(signer), ptr0, len0, ptr1, len1);
|
|
264
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
265
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
266
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
267
|
+
if (r2) {
|
|
268
|
+
throw takeObject(r1);
|
|
269
|
+
}
|
|
270
|
+
return JsonRpcSigner.__wrap(r0);
|
|
271
|
+
}
|
|
272
|
+
finally {
|
|
273
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function _assertClass(instance, klass) {
|
|
277
|
+
if (!(instance instanceof klass)) {
|
|
278
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
279
|
+
}
|
|
280
|
+
return instance.ptr;
|
|
281
|
+
}
|
|
282
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
283
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
284
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
285
|
+
WASM_VECTOR_LEN = arg.length;
|
|
286
|
+
return ptr;
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* @param {ChangePubKeyBuilder} builder
|
|
290
|
+
* @returns {ChangePubKey}
|
|
291
|
+
*/
|
|
292
|
+
export function newChangePubkey(builder) {
|
|
293
|
+
_assertClass(builder, ChangePubKeyBuilder);
|
|
294
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
295
|
+
const ret = wasm.newChangePubkey(ptr0);
|
|
296
|
+
return ChangePubKey.__wrap(ret);
|
|
297
|
+
}
|
|
298
|
+
let cachedUint32Memory0 = null;
|
|
299
|
+
function getUint32Memory0() {
|
|
300
|
+
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
|
301
|
+
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
302
|
+
}
|
|
303
|
+
return cachedUint32Memory0;
|
|
304
|
+
}
|
|
305
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
306
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
307
|
+
const mem = getUint32Memory0();
|
|
308
|
+
for (let i = 0; i < array.length; i++) {
|
|
309
|
+
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
310
|
+
}
|
|
311
|
+
WASM_VECTOR_LEN = array.length;
|
|
312
|
+
return ptr;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* @param {LiquidationBuilder} builder
|
|
316
|
+
* @returns {Liquidation}
|
|
317
|
+
*/
|
|
318
|
+
export function newLiquidation(builder) {
|
|
319
|
+
_assertClass(builder, LiquidationBuilder);
|
|
320
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
321
|
+
const ret = wasm.newLiquidation(ptr0);
|
|
322
|
+
return Liquidation.__wrap(ret);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* @param {ForcedExitBuilder} builder
|
|
326
|
+
* @returns {ForcedExit}
|
|
327
|
+
*/
|
|
328
|
+
export function newForcedExit(builder) {
|
|
329
|
+
_assertClass(builder, ForcedExitBuilder);
|
|
330
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
331
|
+
const ret = wasm.newForcedExit(ptr0);
|
|
332
|
+
return ForcedExit.__wrap(ret);
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* @param {TransferBuilder} builder
|
|
336
|
+
* @returns {Transfer}
|
|
337
|
+
*/
|
|
338
|
+
export function newTransfer(builder) {
|
|
339
|
+
_assertClass(builder, TransferBuilder);
|
|
340
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
341
|
+
const ret = wasm.newTransfer(ptr0);
|
|
342
|
+
return Transfer.__wrap(ret);
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* @param {AutoDeleveragingBuilder} builder
|
|
346
|
+
* @returns {AutoDeleveraging}
|
|
347
|
+
*/
|
|
348
|
+
export function newAutoDeleveraging(builder) {
|
|
349
|
+
_assertClass(builder, AutoDeleveragingBuilder);
|
|
350
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
351
|
+
const ret = wasm.newAutoDeleveraging(ptr0);
|
|
352
|
+
return AutoDeleveraging.__wrap(ret);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* @param {UpdateGlobalVarBuilder} builder
|
|
356
|
+
* @returns {UpdateGlobalVar}
|
|
357
|
+
*/
|
|
358
|
+
export function newUpdateGlobalVar(builder) {
|
|
359
|
+
_assertClass(builder, UpdateGlobalVarBuilder);
|
|
360
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
361
|
+
const ret = wasm.newUpdateGlobalVar(ptr0);
|
|
362
|
+
return UpdateGlobalVar.__wrap(ret);
|
|
363
|
+
}
|
|
364
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
365
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
366
|
+
getUint32Memory0().set(arg, ptr / 4);
|
|
367
|
+
WASM_VECTOR_LEN = arg.length;
|
|
368
|
+
return ptr;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* @param {FundingBuilder} builder
|
|
372
|
+
* @returns {Funding}
|
|
373
|
+
*/
|
|
374
|
+
export function newFunding(builder) {
|
|
375
|
+
_assertClass(builder, FundingBuilder);
|
|
376
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
377
|
+
const ret = wasm.newFunding(ptr0);
|
|
378
|
+
return Funding.__wrap(ret);
|
|
379
|
+
}
|
|
380
|
+
/**
|
|
381
|
+
* @param {WithdrawBuilder} builder
|
|
382
|
+
* @returns {Withdraw}
|
|
383
|
+
*/
|
|
384
|
+
export function newWithdraw(builder) {
|
|
385
|
+
_assertClass(builder, WithdrawBuilder);
|
|
386
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
387
|
+
const ret = wasm.newWithdraw(ptr0);
|
|
388
|
+
return Withdraw.__wrap(ret);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* @param {ContractMatchingBuilder} builder
|
|
392
|
+
* @returns {ContractMatching}
|
|
393
|
+
*/
|
|
394
|
+
export function newContractMatching(builder) {
|
|
395
|
+
_assertClass(builder, ContractMatchingBuilder);
|
|
396
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
397
|
+
const ret = wasm.newContractMatching(ptr0);
|
|
398
|
+
return ContractMatching.__wrap(ret);
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* @param {ContractBuilder} builder
|
|
402
|
+
* @returns {Contract}
|
|
403
|
+
*/
|
|
404
|
+
export function newContract(builder) {
|
|
405
|
+
_assertClass(builder, ContractBuilder);
|
|
406
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
407
|
+
const ret = wasm.newContract(ptr0);
|
|
408
|
+
return Contract.__wrap(ret);
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* @param {OrderMatchingBuilder} builder
|
|
412
|
+
* @returns {OrderMatching}
|
|
413
|
+
*/
|
|
414
|
+
export function newOrderMatching(builder) {
|
|
415
|
+
_assertClass(builder, OrderMatchingBuilder);
|
|
416
|
+
var ptr0 = builder.__destroy_into_raw();
|
|
417
|
+
const ret = wasm.newOrderMatching(ptr0);
|
|
418
|
+
return OrderMatching.__wrap(ret);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* @param {string} amount
|
|
422
|
+
* @returns {boolean}
|
|
423
|
+
*/
|
|
424
|
+
export function isTokenAmountPackable(amount) {
|
|
425
|
+
try {
|
|
426
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
427
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
428
|
+
const len0 = WASM_VECTOR_LEN;
|
|
429
|
+
wasm.isTokenAmountPackable(retptr, ptr0, len0);
|
|
430
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
431
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
432
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
433
|
+
if (r2) {
|
|
434
|
+
throw takeObject(r1);
|
|
435
|
+
}
|
|
436
|
+
return r0 !== 0;
|
|
437
|
+
}
|
|
438
|
+
finally {
|
|
439
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* @param {string} fee
|
|
444
|
+
* @returns {boolean}
|
|
445
|
+
*/
|
|
446
|
+
export function isFeeAmountPackable(fee) {
|
|
447
|
+
try {
|
|
448
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
449
|
+
const ptr0 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
450
|
+
const len0 = WASM_VECTOR_LEN;
|
|
451
|
+
wasm.isFeeAmountPackable(retptr, ptr0, len0);
|
|
452
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
453
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
454
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
455
|
+
if (r2) {
|
|
456
|
+
throw takeObject(r1);
|
|
457
|
+
}
|
|
458
|
+
return r0 !== 0;
|
|
459
|
+
}
|
|
460
|
+
finally {
|
|
461
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* @param {string} amount
|
|
466
|
+
* @returns {string}
|
|
467
|
+
*/
|
|
468
|
+
export function closestPackableTransactionAmount(amount) {
|
|
469
|
+
let deferred3_0;
|
|
470
|
+
let deferred3_1;
|
|
471
|
+
try {
|
|
472
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
473
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
474
|
+
const len0 = WASM_VECTOR_LEN;
|
|
475
|
+
wasm.closestPackableTransactionAmount(retptr, ptr0, len0);
|
|
476
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
477
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
478
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
479
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
480
|
+
var ptr2 = r0;
|
|
481
|
+
var len2 = r1;
|
|
482
|
+
if (r3) {
|
|
483
|
+
ptr2 = 0;
|
|
484
|
+
len2 = 0;
|
|
485
|
+
throw takeObject(r2);
|
|
486
|
+
}
|
|
487
|
+
deferred3_0 = ptr2;
|
|
488
|
+
deferred3_1 = len2;
|
|
489
|
+
return getStringFromWasm0(ptr2, len2);
|
|
490
|
+
}
|
|
491
|
+
finally {
|
|
492
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
493
|
+
wasm.__wbindgen_export_5(deferred3_0, deferred3_1, 1);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* @param {string} fee
|
|
498
|
+
* @returns {string}
|
|
499
|
+
*/
|
|
500
|
+
export function closestPackableTransactionFee(fee) {
|
|
501
|
+
let deferred3_0;
|
|
502
|
+
let deferred3_1;
|
|
503
|
+
try {
|
|
504
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
505
|
+
const ptr0 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
506
|
+
const len0 = WASM_VECTOR_LEN;
|
|
507
|
+
wasm.closestPackableTransactionFee(retptr, ptr0, len0);
|
|
508
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
509
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
510
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
511
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
512
|
+
var ptr2 = r0;
|
|
513
|
+
var len2 = r1;
|
|
514
|
+
if (r3) {
|
|
515
|
+
ptr2 = 0;
|
|
516
|
+
len2 = 0;
|
|
517
|
+
throw takeObject(r2);
|
|
518
|
+
}
|
|
519
|
+
deferred3_0 = ptr2;
|
|
520
|
+
deferred3_1 = len2;
|
|
521
|
+
return getStringFromWasm0(ptr2, len2);
|
|
522
|
+
}
|
|
523
|
+
finally {
|
|
524
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
525
|
+
wasm.__wbindgen_export_5(deferred3_0, deferred3_1, 1);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
function handleError(f, args) {
|
|
529
|
+
try {
|
|
530
|
+
return f.apply(this, args);
|
|
531
|
+
}
|
|
532
|
+
catch (e) {
|
|
533
|
+
wasm.__wbindgen_export_6(addHeapObject(e));
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
function __wbg_adapter_302(arg0, arg1, arg2, arg3) {
|
|
537
|
+
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
*/
|
|
541
|
+
export const WaitForTxStatus = Object.freeze({
|
|
542
|
+
Success: 0,
|
|
543
|
+
0: 'Success',
|
|
544
|
+
Failed: 1,
|
|
545
|
+
1: 'Failed',
|
|
546
|
+
Pending: 2,
|
|
547
|
+
2: 'Pending',
|
|
548
|
+
});
|
|
549
|
+
/**
|
|
550
|
+
*/
|
|
551
|
+
export const EthAuthType = Object.freeze({
|
|
552
|
+
OnChain: 0,
|
|
553
|
+
0: 'OnChain',
|
|
554
|
+
EthECDSA: 1,
|
|
555
|
+
1: 'EthECDSA',
|
|
556
|
+
EthCREATE2: 2,
|
|
557
|
+
2: 'EthCREATE2',
|
|
558
|
+
});
|
|
559
|
+
/**
|
|
560
|
+
*/
|
|
561
|
+
export const L1SignatureType = Object.freeze({ Eth: 0, 0: 'Eth', Eip1271: 1, 1: 'Eip1271', Stark: 2, 2: 'Stark' });
|
|
562
|
+
/**
|
|
563
|
+
* A set of L2 transaction type supported by the zklink network.
|
|
564
|
+
*/
|
|
565
|
+
export const ZkLinkTxType = Object.freeze({
|
|
566
|
+
Deposit: 1,
|
|
567
|
+
1: 'Deposit',
|
|
568
|
+
FullExit: 5,
|
|
569
|
+
5: 'FullExit',
|
|
570
|
+
ChangePubKey: 6,
|
|
571
|
+
6: 'ChangePubKey',
|
|
572
|
+
Transfer: 4,
|
|
573
|
+
4: 'Transfer',
|
|
574
|
+
Withdraw: 3,
|
|
575
|
+
3: 'Withdraw',
|
|
576
|
+
ForcedExit: 7,
|
|
577
|
+
7: 'ForcedExit',
|
|
578
|
+
OrderMatching: 8,
|
|
579
|
+
8: 'OrderMatching',
|
|
580
|
+
AutoDeleveraging: 11,
|
|
581
|
+
11: 'AutoDeleveraging',
|
|
582
|
+
ContractMatching: 9,
|
|
583
|
+
9: 'ContractMatching',
|
|
584
|
+
Funding: 13,
|
|
585
|
+
13: 'Funding',
|
|
586
|
+
Liquidation: 10,
|
|
587
|
+
10: 'Liquidation',
|
|
588
|
+
UpdateGlobalVar: 12,
|
|
589
|
+
12: 'UpdateGlobalVar',
|
|
590
|
+
});
|
|
591
|
+
/**
|
|
592
|
+
*/
|
|
593
|
+
export const BlockNumber = Object.freeze({
|
|
594
|
+
Latest: 0,
|
|
595
|
+
0: 'Latest',
|
|
596
|
+
Finalized: 1,
|
|
597
|
+
1: 'Finalized',
|
|
598
|
+
Safe: 2,
|
|
599
|
+
2: 'Safe',
|
|
600
|
+
Earliest: 3,
|
|
601
|
+
3: 'Earliest',
|
|
602
|
+
Pending: 4,
|
|
603
|
+
4: 'Pending',
|
|
604
|
+
Number: 5,
|
|
605
|
+
5: 'Number',
|
|
606
|
+
});
|
|
607
|
+
/**
|
|
608
|
+
*/
|
|
609
|
+
export const ParameterType = Object.freeze({
|
|
610
|
+
FeeAccount: 0,
|
|
611
|
+
0: 'FeeAccount',
|
|
612
|
+
InsuranceFundAccount: 1,
|
|
613
|
+
1: 'InsuranceFundAccount',
|
|
614
|
+
MarginInfo: 2,
|
|
615
|
+
2: 'MarginInfo',
|
|
616
|
+
FundingInfos: 3,
|
|
617
|
+
3: 'FundingInfos',
|
|
618
|
+
ContractInfo: 4,
|
|
619
|
+
4: 'ContractInfo',
|
|
620
|
+
});
|
|
621
|
+
/**
|
|
622
|
+
*/
|
|
623
|
+
export const AccountQueryType = Object.freeze({ AccountId: 0, 0: 'AccountId', Address: 1, 1: 'Address' });
|
|
624
|
+
const AccountQueryFinalization = typeof FinalizationRegistry === 'undefined'
|
|
625
|
+
? { register: () => { }, unregister: () => { } }
|
|
626
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_accountquery_free(ptr >>> 0));
|
|
627
|
+
/**
|
|
628
|
+
*/
|
|
629
|
+
export class AccountQuery {
|
|
630
|
+
__destroy_into_raw() {
|
|
631
|
+
const ptr = this.__wbg_ptr;
|
|
632
|
+
this.__wbg_ptr = 0;
|
|
633
|
+
AccountQueryFinalization.unregister(this);
|
|
634
|
+
return ptr;
|
|
635
|
+
}
|
|
636
|
+
free() {
|
|
637
|
+
const ptr = this.__destroy_into_raw();
|
|
638
|
+
wasm.__wbg_accountquery_free(ptr);
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* @param {AccountQueryType} query_type
|
|
642
|
+
* @param {string} query_param
|
|
643
|
+
*/
|
|
644
|
+
constructor(query_type, query_param) {
|
|
645
|
+
const ptr0 = passStringToWasm0(query_param, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
646
|
+
const len0 = WASM_VECTOR_LEN;
|
|
647
|
+
const ret = wasm.accountquery_new(query_type, ptr0, len0);
|
|
648
|
+
this.__wbg_ptr = ret >>> 0;
|
|
649
|
+
return this;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
const AutoDeleveragingFinalization = typeof FinalizationRegistry === 'undefined'
|
|
653
|
+
? { register: () => { }, unregister: () => { } }
|
|
654
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_autodeleveraging_free(ptr >>> 0));
|
|
655
|
+
/**
|
|
656
|
+
*/
|
|
657
|
+
export class AutoDeleveraging {
|
|
658
|
+
static __wrap(ptr) {
|
|
659
|
+
ptr = ptr >>> 0;
|
|
660
|
+
const obj = Object.create(AutoDeleveraging.prototype);
|
|
661
|
+
obj.__wbg_ptr = ptr;
|
|
662
|
+
AutoDeleveragingFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
663
|
+
return obj;
|
|
664
|
+
}
|
|
665
|
+
__destroy_into_raw() {
|
|
666
|
+
const ptr = this.__wbg_ptr;
|
|
667
|
+
this.__wbg_ptr = 0;
|
|
668
|
+
AutoDeleveragingFinalization.unregister(this);
|
|
669
|
+
return ptr;
|
|
670
|
+
}
|
|
671
|
+
free() {
|
|
672
|
+
const ptr = this.__destroy_into_raw();
|
|
673
|
+
wasm.__wbg_autodeleveraging_free(ptr);
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* @returns {any}
|
|
677
|
+
*/
|
|
678
|
+
jsValue() {
|
|
679
|
+
try {
|
|
680
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
681
|
+
wasm.autodeleveraging_jsValue(retptr, this.__wbg_ptr);
|
|
682
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
683
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
684
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
685
|
+
if (r2) {
|
|
686
|
+
throw takeObject(r1);
|
|
687
|
+
}
|
|
688
|
+
return takeObject(r0);
|
|
689
|
+
}
|
|
690
|
+
finally {
|
|
691
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* @param {ZkLinkSigner} signer
|
|
696
|
+
* @returns {any}
|
|
697
|
+
*/
|
|
698
|
+
sign(signer) {
|
|
699
|
+
try {
|
|
700
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
701
|
+
_assertClass(signer, ZkLinkSigner);
|
|
702
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
703
|
+
wasm.autodeleveraging_sign(retptr, this.__wbg_ptr, ptr0);
|
|
704
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
705
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
706
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
707
|
+
if (r2) {
|
|
708
|
+
throw takeObject(r1);
|
|
709
|
+
}
|
|
710
|
+
return takeObject(r0);
|
|
711
|
+
}
|
|
712
|
+
finally {
|
|
713
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
const AutoDeleveragingBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
718
|
+
? { register: () => { }, unregister: () => { } }
|
|
719
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_autodeleveragingbuilder_free(ptr >>> 0));
|
|
720
|
+
/**
|
|
721
|
+
*/
|
|
722
|
+
export class AutoDeleveragingBuilder {
|
|
723
|
+
__destroy_into_raw() {
|
|
724
|
+
const ptr = this.__wbg_ptr;
|
|
725
|
+
this.__wbg_ptr = 0;
|
|
726
|
+
AutoDeleveragingBuilderFinalization.unregister(this);
|
|
727
|
+
return ptr;
|
|
728
|
+
}
|
|
729
|
+
free() {
|
|
730
|
+
const ptr = this.__destroy_into_raw();
|
|
731
|
+
wasm.__wbg_autodeleveragingbuilder_free(ptr);
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* @param {number} account_id
|
|
735
|
+
* @param {number} sub_account_id
|
|
736
|
+
* @param {number} sub_account_nonce
|
|
737
|
+
* @param {any[]} contract_prices
|
|
738
|
+
* @param {any[]} margin_prices
|
|
739
|
+
* @param {number} adl_account_id
|
|
740
|
+
* @param {number} pair_id
|
|
741
|
+
* @param {string} adl_size
|
|
742
|
+
* @param {string} adl_price
|
|
743
|
+
* @param {string} fee
|
|
744
|
+
* @param {number} fee_token
|
|
745
|
+
*/
|
|
746
|
+
constructor(account_id, sub_account_id, sub_account_nonce, contract_prices, margin_prices, adl_account_id, pair_id, adl_size, adl_price, fee, fee_token) {
|
|
747
|
+
try {
|
|
748
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
749
|
+
const ptr0 = passArrayJsValueToWasm0(contract_prices, wasm.__wbindgen_export_0);
|
|
750
|
+
const len0 = WASM_VECTOR_LEN;
|
|
751
|
+
const ptr1 = passArrayJsValueToWasm0(margin_prices, wasm.__wbindgen_export_0);
|
|
752
|
+
const len1 = WASM_VECTOR_LEN;
|
|
753
|
+
const ptr2 = passStringToWasm0(adl_size, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
754
|
+
const len2 = WASM_VECTOR_LEN;
|
|
755
|
+
const ptr3 = passStringToWasm0(adl_price, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
756
|
+
const len3 = WASM_VECTOR_LEN;
|
|
757
|
+
const ptr4 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
758
|
+
const len4 = WASM_VECTOR_LEN;
|
|
759
|
+
wasm.autodeleveragingbuilder_new(retptr, account_id, sub_account_id, sub_account_nonce, ptr0, len0, ptr1, len1, adl_account_id, pair_id, ptr2, len2, ptr3, len3, ptr4, len4, fee_token);
|
|
760
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
761
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
762
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
763
|
+
if (r2) {
|
|
764
|
+
throw takeObject(r1);
|
|
765
|
+
}
|
|
766
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
767
|
+
return this;
|
|
768
|
+
}
|
|
769
|
+
finally {
|
|
770
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
/**
|
|
774
|
+
* @returns {AutoDeleveraging}
|
|
775
|
+
*/
|
|
776
|
+
build() {
|
|
777
|
+
const ptr = this.__destroy_into_raw();
|
|
778
|
+
const ret = wasm.autodeleveragingbuilder_build(ptr);
|
|
779
|
+
return AutoDeleveraging.__wrap(ret);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
const ChangePubKeyFinalization = typeof FinalizationRegistry === 'undefined'
|
|
783
|
+
? { register: () => { }, unregister: () => { } }
|
|
784
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_changepubkey_free(ptr >>> 0));
|
|
785
|
+
/**
|
|
786
|
+
*/
|
|
787
|
+
export class ChangePubKey {
|
|
788
|
+
static __wrap(ptr) {
|
|
789
|
+
ptr = ptr >>> 0;
|
|
790
|
+
const obj = Object.create(ChangePubKey.prototype);
|
|
791
|
+
obj.__wbg_ptr = ptr;
|
|
792
|
+
ChangePubKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
793
|
+
return obj;
|
|
794
|
+
}
|
|
795
|
+
__destroy_into_raw() {
|
|
796
|
+
const ptr = this.__wbg_ptr;
|
|
797
|
+
this.__wbg_ptr = 0;
|
|
798
|
+
ChangePubKeyFinalization.unregister(this);
|
|
799
|
+
return ptr;
|
|
800
|
+
}
|
|
801
|
+
free() {
|
|
802
|
+
const ptr = this.__destroy_into_raw();
|
|
803
|
+
wasm.__wbg_changepubkey_free(ptr);
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* @returns {any}
|
|
807
|
+
*/
|
|
808
|
+
jsValue() {
|
|
809
|
+
try {
|
|
810
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
811
|
+
wasm.changepubkey_jsValue(retptr, this.__wbg_ptr);
|
|
812
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
813
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
814
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
815
|
+
if (r2) {
|
|
816
|
+
throw takeObject(r1);
|
|
817
|
+
}
|
|
818
|
+
return takeObject(r0);
|
|
819
|
+
}
|
|
820
|
+
finally {
|
|
821
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* @param {number} layer_one_chain_id
|
|
826
|
+
* @param {string} verifying_contract
|
|
827
|
+
* @returns {string}
|
|
828
|
+
*/
|
|
829
|
+
getChangePubkeyMessage(layer_one_chain_id, verifying_contract) {
|
|
830
|
+
let deferred3_0;
|
|
831
|
+
let deferred3_1;
|
|
832
|
+
try {
|
|
833
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
834
|
+
const ptr0 = passStringToWasm0(verifying_contract, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
835
|
+
const len0 = WASM_VECTOR_LEN;
|
|
836
|
+
wasm.changepubkey_getChangePubkeyMessage(retptr, this.__wbg_ptr, layer_one_chain_id, ptr0, len0);
|
|
837
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
838
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
839
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
840
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
841
|
+
var ptr2 = r0;
|
|
842
|
+
var len2 = r1;
|
|
843
|
+
if (r3) {
|
|
844
|
+
ptr2 = 0;
|
|
845
|
+
len2 = 0;
|
|
846
|
+
throw takeObject(r2);
|
|
847
|
+
}
|
|
848
|
+
deferred3_0 = ptr2;
|
|
849
|
+
deferred3_1 = len2;
|
|
850
|
+
return getStringFromWasm0(ptr2, len2);
|
|
851
|
+
}
|
|
852
|
+
finally {
|
|
853
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
854
|
+
wasm.__wbindgen_export_5(deferred3_0, deferred3_1, 1);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* @param {number} nonce
|
|
859
|
+
* @param {number} account_id
|
|
860
|
+
* @returns {string}
|
|
861
|
+
*/
|
|
862
|
+
getEthSignMsg(nonce, account_id) {
|
|
863
|
+
let deferred1_0;
|
|
864
|
+
let deferred1_1;
|
|
865
|
+
try {
|
|
866
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
867
|
+
wasm.changepubkey_getEthSignMsg(retptr, this.__wbg_ptr, nonce, account_id);
|
|
868
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
869
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
870
|
+
deferred1_0 = r0;
|
|
871
|
+
deferred1_1 = r1;
|
|
872
|
+
return getStringFromWasm0(r0, r1);
|
|
873
|
+
}
|
|
874
|
+
finally {
|
|
875
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
876
|
+
wasm.__wbindgen_export_5(deferred1_0, deferred1_1, 1);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* @param {string} sig
|
|
881
|
+
* @returns {any}
|
|
882
|
+
*/
|
|
883
|
+
setEthAuthData(sig) {
|
|
884
|
+
try {
|
|
885
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
886
|
+
const ptr0 = passStringToWasm0(sig, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
887
|
+
const len0 = WASM_VECTOR_LEN;
|
|
888
|
+
wasm.changepubkey_setEthAuthData(retptr, this.__wbg_ptr, ptr0, len0);
|
|
889
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
890
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
891
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
892
|
+
if (r2) {
|
|
893
|
+
throw takeObject(r1);
|
|
894
|
+
}
|
|
895
|
+
return takeObject(r0);
|
|
896
|
+
}
|
|
897
|
+
finally {
|
|
898
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
/**
|
|
902
|
+
* @param {ZkLinkSigner} signer
|
|
903
|
+
* @returns {any}
|
|
904
|
+
*/
|
|
905
|
+
sign(signer) {
|
|
906
|
+
try {
|
|
907
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
908
|
+
_assertClass(signer, ZkLinkSigner);
|
|
909
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
910
|
+
wasm.changepubkey_sign(retptr, this.__wbg_ptr, ptr0);
|
|
911
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
912
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
913
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
914
|
+
if (r2) {
|
|
915
|
+
throw takeObject(r1);
|
|
916
|
+
}
|
|
917
|
+
return takeObject(r0);
|
|
918
|
+
}
|
|
919
|
+
finally {
|
|
920
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
const ChangePubKeyBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
925
|
+
? { register: () => { }, unregister: () => { } }
|
|
926
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_changepubkeybuilder_free(ptr >>> 0));
|
|
927
|
+
/**
|
|
928
|
+
*/
|
|
929
|
+
export class ChangePubKeyBuilder {
|
|
930
|
+
__destroy_into_raw() {
|
|
931
|
+
const ptr = this.__wbg_ptr;
|
|
932
|
+
this.__wbg_ptr = 0;
|
|
933
|
+
ChangePubKeyBuilderFinalization.unregister(this);
|
|
934
|
+
return ptr;
|
|
935
|
+
}
|
|
936
|
+
free() {
|
|
937
|
+
const ptr = this.__destroy_into_raw();
|
|
938
|
+
wasm.__wbg_changepubkeybuilder_free(ptr);
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* @param {number} chain_id
|
|
942
|
+
* @param {number} account_id
|
|
943
|
+
* @param {number} sub_account_id
|
|
944
|
+
* @param {string} new_pubkey_hash
|
|
945
|
+
* @param {number} fee_token
|
|
946
|
+
* @param {string} fee
|
|
947
|
+
* @param {number} nonce
|
|
948
|
+
* @param {string | undefined} [eth_signature]
|
|
949
|
+
* @param {number | undefined} [ts]
|
|
950
|
+
*/
|
|
951
|
+
constructor(chain_id, account_id, sub_account_id, new_pubkey_hash, fee_token, fee, nonce, eth_signature, ts) {
|
|
952
|
+
try {
|
|
953
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
954
|
+
const ptr0 = passStringToWasm0(new_pubkey_hash, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
955
|
+
const len0 = WASM_VECTOR_LEN;
|
|
956
|
+
const ptr1 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
957
|
+
const len1 = WASM_VECTOR_LEN;
|
|
958
|
+
var ptr2 = isLikeNone(eth_signature)
|
|
959
|
+
? 0
|
|
960
|
+
: passStringToWasm0(eth_signature, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
961
|
+
var len2 = WASM_VECTOR_LEN;
|
|
962
|
+
wasm.changepubkeybuilder_new(retptr, chain_id, account_id, sub_account_id, ptr0, len0, fee_token, ptr1, len1, nonce, ptr2, len2, !isLikeNone(ts), isLikeNone(ts) ? 0 : ts);
|
|
963
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
964
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
965
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
966
|
+
if (r2) {
|
|
967
|
+
throw takeObject(r1);
|
|
968
|
+
}
|
|
969
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
970
|
+
return this;
|
|
971
|
+
}
|
|
972
|
+
finally {
|
|
973
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
/**
|
|
977
|
+
* @returns {ChangePubKey}
|
|
978
|
+
*/
|
|
979
|
+
build() {
|
|
980
|
+
const ptr = this.__destroy_into_raw();
|
|
981
|
+
const ret = wasm.changepubkeybuilder_build(ptr);
|
|
982
|
+
return ChangePubKey.__wrap(ret);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
const ContractFinalization = typeof FinalizationRegistry === 'undefined'
|
|
986
|
+
? { register: () => { }, unregister: () => { } }
|
|
987
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contract_free(ptr >>> 0));
|
|
988
|
+
/**
|
|
989
|
+
*/
|
|
990
|
+
export class Contract {
|
|
991
|
+
static __wrap(ptr) {
|
|
992
|
+
ptr = ptr >>> 0;
|
|
993
|
+
const obj = Object.create(Contract.prototype);
|
|
994
|
+
obj.__wbg_ptr = ptr;
|
|
995
|
+
ContractFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
996
|
+
return obj;
|
|
997
|
+
}
|
|
998
|
+
__destroy_into_raw() {
|
|
999
|
+
const ptr = this.__wbg_ptr;
|
|
1000
|
+
this.__wbg_ptr = 0;
|
|
1001
|
+
ContractFinalization.unregister(this);
|
|
1002
|
+
return ptr;
|
|
1003
|
+
}
|
|
1004
|
+
free() {
|
|
1005
|
+
const ptr = this.__destroy_into_raw();
|
|
1006
|
+
wasm.__wbg_contract_free(ptr);
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* @returns {any}
|
|
1010
|
+
*/
|
|
1011
|
+
jsValue() {
|
|
1012
|
+
try {
|
|
1013
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1014
|
+
wasm.contract_jsValue(retptr, this.__wbg_ptr);
|
|
1015
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1016
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1017
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1018
|
+
if (r2) {
|
|
1019
|
+
throw takeObject(r1);
|
|
1020
|
+
}
|
|
1021
|
+
return takeObject(r0);
|
|
1022
|
+
}
|
|
1023
|
+
finally {
|
|
1024
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1025
|
+
}
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* @param {ZkLinkSigner} signer
|
|
1029
|
+
* @returns {any}
|
|
1030
|
+
*/
|
|
1031
|
+
sign(signer) {
|
|
1032
|
+
try {
|
|
1033
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1034
|
+
_assertClass(signer, ZkLinkSigner);
|
|
1035
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
1036
|
+
wasm.contract_sign(retptr, this.__wbg_ptr, ptr0);
|
|
1037
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1038
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1039
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1040
|
+
if (r2) {
|
|
1041
|
+
throw takeObject(r1);
|
|
1042
|
+
}
|
|
1043
|
+
return takeObject(r0);
|
|
1044
|
+
}
|
|
1045
|
+
finally {
|
|
1046
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
const ContractBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1051
|
+
? { register: () => { }, unregister: () => { } }
|
|
1052
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractbuilder_free(ptr >>> 0));
|
|
1053
|
+
/**
|
|
1054
|
+
*/
|
|
1055
|
+
export class ContractBuilder {
|
|
1056
|
+
__destroy_into_raw() {
|
|
1057
|
+
const ptr = this.__wbg_ptr;
|
|
1058
|
+
this.__wbg_ptr = 0;
|
|
1059
|
+
ContractBuilderFinalization.unregister(this);
|
|
1060
|
+
return ptr;
|
|
1061
|
+
}
|
|
1062
|
+
free() {
|
|
1063
|
+
const ptr = this.__destroy_into_raw();
|
|
1064
|
+
wasm.__wbg_contractbuilder_free(ptr);
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* @param {number} account_id
|
|
1068
|
+
* @param {number} sub_account_id
|
|
1069
|
+
* @param {number} slot_id
|
|
1070
|
+
* @param {number} nonce
|
|
1071
|
+
* @param {number} pair_id
|
|
1072
|
+
* @param {string} size
|
|
1073
|
+
* @param {string} price
|
|
1074
|
+
* @param {boolean} direction
|
|
1075
|
+
* @param {number} maker_fee_rate
|
|
1076
|
+
* @param {number} taker_fee_rate
|
|
1077
|
+
* @param {boolean} has_subsidy
|
|
1078
|
+
*/
|
|
1079
|
+
constructor(account_id, sub_account_id, slot_id, nonce, pair_id, size, price, direction, maker_fee_rate, taker_fee_rate, has_subsidy) {
|
|
1080
|
+
try {
|
|
1081
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1082
|
+
const ptr0 = passStringToWasm0(size, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1083
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1084
|
+
const ptr1 = passStringToWasm0(price, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1085
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1086
|
+
wasm.contractbuilder_new(retptr, account_id, sub_account_id, slot_id, nonce, pair_id, ptr0, len0, ptr1, len1, direction, maker_fee_rate, taker_fee_rate, has_subsidy);
|
|
1087
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1088
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1089
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1090
|
+
if (r2) {
|
|
1091
|
+
throw takeObject(r1);
|
|
1092
|
+
}
|
|
1093
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1094
|
+
return this;
|
|
1095
|
+
}
|
|
1096
|
+
finally {
|
|
1097
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* @returns {Contract}
|
|
1102
|
+
*/
|
|
1103
|
+
build() {
|
|
1104
|
+
const ptr = this.__destroy_into_raw();
|
|
1105
|
+
const ret = wasm.contractbuilder_build(ptr);
|
|
1106
|
+
return Contract.__wrap(ret);
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
const ContractInfoFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1110
|
+
? { register: () => { }, unregister: () => { } }
|
|
1111
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractinfo_free(ptr >>> 0));
|
|
1112
|
+
/**
|
|
1113
|
+
*/
|
|
1114
|
+
export class ContractInfo {
|
|
1115
|
+
__destroy_into_raw() {
|
|
1116
|
+
const ptr = this.__wbg_ptr;
|
|
1117
|
+
this.__wbg_ptr = 0;
|
|
1118
|
+
ContractInfoFinalization.unregister(this);
|
|
1119
|
+
return ptr;
|
|
1120
|
+
}
|
|
1121
|
+
free() {
|
|
1122
|
+
const ptr = this.__destroy_into_raw();
|
|
1123
|
+
wasm.__wbg_contractinfo_free(ptr);
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* @param {number} pair_id
|
|
1127
|
+
* @param {string} symbol
|
|
1128
|
+
* @param {number} initial_margin_rate
|
|
1129
|
+
* @param {number} maintenance_margin_rate
|
|
1130
|
+
*/
|
|
1131
|
+
constructor(pair_id, symbol, initial_margin_rate, maintenance_margin_rate) {
|
|
1132
|
+
const ptr0 = passStringToWasm0(symbol, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1133
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1134
|
+
const ret = wasm.contractinfo_new(pair_id, ptr0, len0, initial_margin_rate, maintenance_margin_rate);
|
|
1135
|
+
this.__wbg_ptr = ret >>> 0;
|
|
1136
|
+
return this;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* @returns {any}
|
|
1140
|
+
*/
|
|
1141
|
+
jsValue() {
|
|
1142
|
+
try {
|
|
1143
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1144
|
+
wasm.contractinfo_jsValue(retptr, this.__wbg_ptr);
|
|
1145
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1146
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1147
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1148
|
+
if (r2) {
|
|
1149
|
+
throw takeObject(r1);
|
|
1150
|
+
}
|
|
1151
|
+
return takeObject(r0);
|
|
1152
|
+
}
|
|
1153
|
+
finally {
|
|
1154
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
const ContractMatchingFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1159
|
+
? { register: () => { }, unregister: () => { } }
|
|
1160
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractmatching_free(ptr >>> 0));
|
|
1161
|
+
/**
|
|
1162
|
+
*/
|
|
1163
|
+
export class ContractMatching {
|
|
1164
|
+
static __wrap(ptr) {
|
|
1165
|
+
ptr = ptr >>> 0;
|
|
1166
|
+
const obj = Object.create(ContractMatching.prototype);
|
|
1167
|
+
obj.__wbg_ptr = ptr;
|
|
1168
|
+
ContractMatchingFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1169
|
+
return obj;
|
|
1170
|
+
}
|
|
1171
|
+
__destroy_into_raw() {
|
|
1172
|
+
const ptr = this.__wbg_ptr;
|
|
1173
|
+
this.__wbg_ptr = 0;
|
|
1174
|
+
ContractMatchingFinalization.unregister(this);
|
|
1175
|
+
return ptr;
|
|
1176
|
+
}
|
|
1177
|
+
free() {
|
|
1178
|
+
const ptr = this.__destroy_into_raw();
|
|
1179
|
+
wasm.__wbg_contractmatching_free(ptr);
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* @returns {any}
|
|
1183
|
+
*/
|
|
1184
|
+
jsValue() {
|
|
1185
|
+
try {
|
|
1186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1187
|
+
wasm.contractmatching_jsValue(retptr, this.__wbg_ptr);
|
|
1188
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1189
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1190
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1191
|
+
if (r2) {
|
|
1192
|
+
throw takeObject(r1);
|
|
1193
|
+
}
|
|
1194
|
+
return takeObject(r0);
|
|
1195
|
+
}
|
|
1196
|
+
finally {
|
|
1197
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* @param {ZkLinkSigner} signer
|
|
1202
|
+
* @returns {any}
|
|
1203
|
+
*/
|
|
1204
|
+
sign(signer) {
|
|
1205
|
+
try {
|
|
1206
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1207
|
+
_assertClass(signer, ZkLinkSigner);
|
|
1208
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
1209
|
+
wasm.contractmatching_sign(retptr, this.__wbg_ptr, ptr0);
|
|
1210
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1211
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1212
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1213
|
+
if (r2) {
|
|
1214
|
+
throw takeObject(r1);
|
|
1215
|
+
}
|
|
1216
|
+
return takeObject(r0);
|
|
1217
|
+
}
|
|
1218
|
+
finally {
|
|
1219
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
const ContractMatchingBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1224
|
+
? { register: () => { }, unregister: () => { } }
|
|
1225
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractmatchingbuilder_free(ptr >>> 0));
|
|
1226
|
+
/**
|
|
1227
|
+
*/
|
|
1228
|
+
export class ContractMatchingBuilder {
|
|
1229
|
+
__destroy_into_raw() {
|
|
1230
|
+
const ptr = this.__wbg_ptr;
|
|
1231
|
+
this.__wbg_ptr = 0;
|
|
1232
|
+
ContractMatchingBuilderFinalization.unregister(this);
|
|
1233
|
+
return ptr;
|
|
1234
|
+
}
|
|
1235
|
+
free() {
|
|
1236
|
+
const ptr = this.__destroy_into_raw();
|
|
1237
|
+
wasm.__wbg_contractmatchingbuilder_free(ptr);
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* @param {number} account_id
|
|
1241
|
+
* @param {number} sub_account_id
|
|
1242
|
+
* @param {any} taker
|
|
1243
|
+
* @param {any[]} maker
|
|
1244
|
+
* @param {string} fee
|
|
1245
|
+
* @param {number} fee_token
|
|
1246
|
+
* @param {any[]} contract_prices
|
|
1247
|
+
* @param {any[]} margin_prices
|
|
1248
|
+
*/
|
|
1249
|
+
constructor(account_id, sub_account_id, taker, maker, fee, fee_token, contract_prices, margin_prices) {
|
|
1250
|
+
try {
|
|
1251
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1252
|
+
const ptr0 = passArrayJsValueToWasm0(maker, wasm.__wbindgen_export_0);
|
|
1253
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1254
|
+
const ptr1 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1255
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1256
|
+
const ptr2 = passArrayJsValueToWasm0(contract_prices, wasm.__wbindgen_export_0);
|
|
1257
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1258
|
+
const ptr3 = passArrayJsValueToWasm0(margin_prices, wasm.__wbindgen_export_0);
|
|
1259
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1260
|
+
wasm.contractmatchingbuilder_new(retptr, account_id, sub_account_id, addHeapObject(taker), ptr0, len0, ptr1, len1, fee_token, ptr2, len2, ptr3, len3);
|
|
1261
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1262
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1263
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1264
|
+
if (r2) {
|
|
1265
|
+
throw takeObject(r1);
|
|
1266
|
+
}
|
|
1267
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1268
|
+
return this;
|
|
1269
|
+
}
|
|
1270
|
+
finally {
|
|
1271
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1272
|
+
}
|
|
1273
|
+
}
|
|
1274
|
+
/**
|
|
1275
|
+
* @returns {ContractMatching}
|
|
1276
|
+
*/
|
|
1277
|
+
build() {
|
|
1278
|
+
const ptr = this.__destroy_into_raw();
|
|
1279
|
+
const ret = wasm.contractmatchingbuilder_build(ptr);
|
|
1280
|
+
return ContractMatching.__wrap(ret);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
const ContractPriceFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1284
|
+
? { register: () => { }, unregister: () => { } }
|
|
1285
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_contractprice_free(ptr >>> 0));
|
|
1286
|
+
/**
|
|
1287
|
+
*/
|
|
1288
|
+
export class ContractPrice {
|
|
1289
|
+
__destroy_into_raw() {
|
|
1290
|
+
const ptr = this.__wbg_ptr;
|
|
1291
|
+
this.__wbg_ptr = 0;
|
|
1292
|
+
ContractPriceFinalization.unregister(this);
|
|
1293
|
+
return ptr;
|
|
1294
|
+
}
|
|
1295
|
+
free() {
|
|
1296
|
+
const ptr = this.__destroy_into_raw();
|
|
1297
|
+
wasm.__wbg_contractprice_free(ptr);
|
|
1298
|
+
}
|
|
1299
|
+
/**
|
|
1300
|
+
* @param {number} pair_id
|
|
1301
|
+
* @param {string} market_price
|
|
1302
|
+
*/
|
|
1303
|
+
constructor(pair_id, market_price) {
|
|
1304
|
+
try {
|
|
1305
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1306
|
+
const ptr0 = passStringToWasm0(market_price, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1307
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1308
|
+
wasm.contractprice_new(retptr, pair_id, ptr0, len0);
|
|
1309
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1310
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1311
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1312
|
+
if (r2) {
|
|
1313
|
+
throw takeObject(r1);
|
|
1314
|
+
}
|
|
1315
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1316
|
+
return this;
|
|
1317
|
+
}
|
|
1318
|
+
finally {
|
|
1319
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
/**
|
|
1323
|
+
* @returns {any}
|
|
1324
|
+
*/
|
|
1325
|
+
jsValue() {
|
|
1326
|
+
try {
|
|
1327
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1328
|
+
wasm.contractprice_jsValue(retptr, this.__wbg_ptr);
|
|
1329
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1330
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1331
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1332
|
+
if (r2) {
|
|
1333
|
+
throw takeObject(r1);
|
|
1334
|
+
}
|
|
1335
|
+
return takeObject(r0);
|
|
1336
|
+
}
|
|
1337
|
+
finally {
|
|
1338
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1339
|
+
}
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
const Create2DataFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1343
|
+
? { register: () => { }, unregister: () => { } }
|
|
1344
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_create2data_free(ptr >>> 0));
|
|
1345
|
+
/**
|
|
1346
|
+
*/
|
|
1347
|
+
export class Create2Data {
|
|
1348
|
+
__destroy_into_raw() {
|
|
1349
|
+
const ptr = this.__wbg_ptr;
|
|
1350
|
+
this.__wbg_ptr = 0;
|
|
1351
|
+
Create2DataFinalization.unregister(this);
|
|
1352
|
+
return ptr;
|
|
1353
|
+
}
|
|
1354
|
+
free() {
|
|
1355
|
+
const ptr = this.__destroy_into_raw();
|
|
1356
|
+
wasm.__wbg_create2data_free(ptr);
|
|
1357
|
+
}
|
|
1358
|
+
/**
|
|
1359
|
+
* @param {string} creator_address
|
|
1360
|
+
* @param {string} salt
|
|
1361
|
+
* @param {string} code_hash
|
|
1362
|
+
*/
|
|
1363
|
+
constructor(creator_address, salt, code_hash) {
|
|
1364
|
+
try {
|
|
1365
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1366
|
+
const ptr0 = passStringToWasm0(creator_address, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1367
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1368
|
+
const ptr1 = passStringToWasm0(salt, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1369
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1370
|
+
const ptr2 = passStringToWasm0(code_hash, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1371
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1372
|
+
wasm.create2data_new(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1373
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1374
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1375
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1376
|
+
if (r2) {
|
|
1377
|
+
throw takeObject(r1);
|
|
1378
|
+
}
|
|
1379
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1380
|
+
return this;
|
|
1381
|
+
}
|
|
1382
|
+
finally {
|
|
1383
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
/**
|
|
1387
|
+
* @param {string} pubkey_hash
|
|
1388
|
+
* @returns {string}
|
|
1389
|
+
*/
|
|
1390
|
+
salt(pubkey_hash) {
|
|
1391
|
+
let deferred2_0;
|
|
1392
|
+
let deferred2_1;
|
|
1393
|
+
try {
|
|
1394
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1395
|
+
const ptr0 = passStringToWasm0(pubkey_hash, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1396
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1397
|
+
wasm.create2data_salt(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1398
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1399
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1400
|
+
deferred2_0 = r0;
|
|
1401
|
+
deferred2_1 = r1;
|
|
1402
|
+
return getStringFromWasm0(r0, r1);
|
|
1403
|
+
}
|
|
1404
|
+
finally {
|
|
1405
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1406
|
+
wasm.__wbindgen_export_5(deferred2_0, deferred2_1, 1);
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* @returns {any}
|
|
1411
|
+
*/
|
|
1412
|
+
jsValue() {
|
|
1413
|
+
try {
|
|
1414
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1415
|
+
wasm.create2data_jsValue(retptr, this.__wbg_ptr);
|
|
1416
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1417
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1418
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1419
|
+
if (r2) {
|
|
1420
|
+
throw takeObject(r1);
|
|
1421
|
+
}
|
|
1422
|
+
return takeObject(r0);
|
|
1423
|
+
}
|
|
1424
|
+
finally {
|
|
1425
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
const EthTxOptionFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1430
|
+
? { register: () => { }, unregister: () => { } }
|
|
1431
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ethtxoption_free(ptr >>> 0));
|
|
1432
|
+
/**
|
|
1433
|
+
*/
|
|
1434
|
+
export class EthTxOption {
|
|
1435
|
+
__destroy_into_raw() {
|
|
1436
|
+
const ptr = this.__wbg_ptr;
|
|
1437
|
+
this.__wbg_ptr = 0;
|
|
1438
|
+
EthTxOptionFinalization.unregister(this);
|
|
1439
|
+
return ptr;
|
|
1440
|
+
}
|
|
1441
|
+
free() {
|
|
1442
|
+
const ptr = this.__destroy_into_raw();
|
|
1443
|
+
wasm.__wbg_ethtxoption_free(ptr);
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* @param {boolean} is_support_eip1559
|
|
1447
|
+
* @param {string} to
|
|
1448
|
+
* @param {number | undefined} [nonce]
|
|
1449
|
+
* @param {string | undefined} [value]
|
|
1450
|
+
* @param {number | undefined} [gas]
|
|
1451
|
+
* @param {string | undefined} [gas_price]
|
|
1452
|
+
*/
|
|
1453
|
+
constructor(is_support_eip1559, to, nonce, value, gas, gas_price) {
|
|
1454
|
+
try {
|
|
1455
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1456
|
+
const ptr0 = passStringToWasm0(to, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1457
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1458
|
+
var ptr1 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1459
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1460
|
+
var ptr2 = isLikeNone(gas_price)
|
|
1461
|
+
? 0
|
|
1462
|
+
: passStringToWasm0(gas_price, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1463
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1464
|
+
wasm.ethtxoption_new(retptr, is_support_eip1559, ptr0, len0, !isLikeNone(nonce), isLikeNone(nonce) ? 0 : nonce, ptr1, len1, !isLikeNone(gas), isLikeNone(gas) ? 0 : gas, ptr2, len2);
|
|
1465
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1466
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1467
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1468
|
+
if (r2) {
|
|
1469
|
+
throw takeObject(r1);
|
|
1470
|
+
}
|
|
1471
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1472
|
+
return this;
|
|
1473
|
+
}
|
|
1474
|
+
finally {
|
|
1475
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* @returns {any}
|
|
1480
|
+
*/
|
|
1481
|
+
jsValue() {
|
|
1482
|
+
try {
|
|
1483
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1484
|
+
wasm.ethtxoption_jsValue(retptr, this.__wbg_ptr);
|
|
1485
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1486
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1487
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1488
|
+
if (r2) {
|
|
1489
|
+
throw takeObject(r1);
|
|
1490
|
+
}
|
|
1491
|
+
return takeObject(r0);
|
|
1492
|
+
}
|
|
1493
|
+
finally {
|
|
1494
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1495
|
+
}
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
const ForcedExitFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1499
|
+
? { register: () => { }, unregister: () => { } }
|
|
1500
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_forcedexit_free(ptr >>> 0));
|
|
1501
|
+
/**
|
|
1502
|
+
*/
|
|
1503
|
+
export class ForcedExit {
|
|
1504
|
+
static __wrap(ptr) {
|
|
1505
|
+
ptr = ptr >>> 0;
|
|
1506
|
+
const obj = Object.create(ForcedExit.prototype);
|
|
1507
|
+
obj.__wbg_ptr = ptr;
|
|
1508
|
+
ForcedExitFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1509
|
+
return obj;
|
|
1510
|
+
}
|
|
1511
|
+
__destroy_into_raw() {
|
|
1512
|
+
const ptr = this.__wbg_ptr;
|
|
1513
|
+
this.__wbg_ptr = 0;
|
|
1514
|
+
ForcedExitFinalization.unregister(this);
|
|
1515
|
+
return ptr;
|
|
1516
|
+
}
|
|
1517
|
+
free() {
|
|
1518
|
+
const ptr = this.__destroy_into_raw();
|
|
1519
|
+
wasm.__wbg_forcedexit_free(ptr);
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* @returns {any}
|
|
1523
|
+
*/
|
|
1524
|
+
jsValue() {
|
|
1525
|
+
try {
|
|
1526
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1527
|
+
wasm.forcedexit_jsValue(retptr, this.__wbg_ptr);
|
|
1528
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1529
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1530
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1531
|
+
if (r2) {
|
|
1532
|
+
throw takeObject(r1);
|
|
1533
|
+
}
|
|
1534
|
+
return takeObject(r0);
|
|
1535
|
+
}
|
|
1536
|
+
finally {
|
|
1537
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
/**
|
|
1541
|
+
* @param {ZkLinkSigner} signer
|
|
1542
|
+
* @returns {any}
|
|
1543
|
+
*/
|
|
1544
|
+
sign(signer) {
|
|
1545
|
+
try {
|
|
1546
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1547
|
+
_assertClass(signer, ZkLinkSigner);
|
|
1548
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
1549
|
+
wasm.forcedexit_sign(retptr, this.__wbg_ptr, ptr0);
|
|
1550
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1551
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1552
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1553
|
+
if (r2) {
|
|
1554
|
+
throw takeObject(r1);
|
|
1555
|
+
}
|
|
1556
|
+
return takeObject(r0);
|
|
1557
|
+
}
|
|
1558
|
+
finally {
|
|
1559
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
const ForcedExitBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1564
|
+
? { register: () => { }, unregister: () => { } }
|
|
1565
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_forcedexitbuilder_free(ptr >>> 0));
|
|
1566
|
+
/**
|
|
1567
|
+
*/
|
|
1568
|
+
export class ForcedExitBuilder {
|
|
1569
|
+
__destroy_into_raw() {
|
|
1570
|
+
const ptr = this.__wbg_ptr;
|
|
1571
|
+
this.__wbg_ptr = 0;
|
|
1572
|
+
ForcedExitBuilderFinalization.unregister(this);
|
|
1573
|
+
return ptr;
|
|
1574
|
+
}
|
|
1575
|
+
free() {
|
|
1576
|
+
const ptr = this.__destroy_into_raw();
|
|
1577
|
+
wasm.__wbg_forcedexitbuilder_free(ptr);
|
|
1578
|
+
}
|
|
1579
|
+
/**
|
|
1580
|
+
* @param {number} to_chain_id
|
|
1581
|
+
* @param {number} initiator_account_id
|
|
1582
|
+
* @param {number} initiator_sub_account_id
|
|
1583
|
+
* @param {number} target_sub_account_id
|
|
1584
|
+
* @param {string} target
|
|
1585
|
+
* @param {number} l2_source_token
|
|
1586
|
+
* @param {number} l1_target_token
|
|
1587
|
+
* @param {string} exit_amount
|
|
1588
|
+
* @param {number} initiator_nonce
|
|
1589
|
+
* @param {boolean} withdraw_to_l1
|
|
1590
|
+
* @param {number | undefined} [ts]
|
|
1591
|
+
*/
|
|
1592
|
+
constructor(to_chain_id, initiator_account_id, initiator_sub_account_id, target_sub_account_id, target, l2_source_token, l1_target_token, exit_amount, initiator_nonce, withdraw_to_l1, ts) {
|
|
1593
|
+
try {
|
|
1594
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1595
|
+
const ptr0 = passStringToWasm0(target, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1596
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1597
|
+
const ptr1 = passStringToWasm0(exit_amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1598
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1599
|
+
wasm.forcedexitbuilder_new(retptr, to_chain_id, initiator_account_id, initiator_sub_account_id, target_sub_account_id, ptr0, len0, l2_source_token, l1_target_token, ptr1, len1, initiator_nonce, withdraw_to_l1, !isLikeNone(ts), isLikeNone(ts) ? 0 : ts);
|
|
1600
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1601
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1602
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1603
|
+
if (r2) {
|
|
1604
|
+
throw takeObject(r1);
|
|
1605
|
+
}
|
|
1606
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1607
|
+
return this;
|
|
1608
|
+
}
|
|
1609
|
+
finally {
|
|
1610
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* @returns {ForcedExit}
|
|
1615
|
+
*/
|
|
1616
|
+
build() {
|
|
1617
|
+
const ptr = this.__destroy_into_raw();
|
|
1618
|
+
const ret = wasm.forcedexitbuilder_build(ptr);
|
|
1619
|
+
return ForcedExit.__wrap(ret);
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
const FundingFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1623
|
+
? { register: () => { }, unregister: () => { } }
|
|
1624
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_funding_free(ptr >>> 0));
|
|
1625
|
+
/**
|
|
1626
|
+
*/
|
|
1627
|
+
export class Funding {
|
|
1628
|
+
static __wrap(ptr) {
|
|
1629
|
+
ptr = ptr >>> 0;
|
|
1630
|
+
const obj = Object.create(Funding.prototype);
|
|
1631
|
+
obj.__wbg_ptr = ptr;
|
|
1632
|
+
FundingFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1633
|
+
return obj;
|
|
1634
|
+
}
|
|
1635
|
+
__destroy_into_raw() {
|
|
1636
|
+
const ptr = this.__wbg_ptr;
|
|
1637
|
+
this.__wbg_ptr = 0;
|
|
1638
|
+
FundingFinalization.unregister(this);
|
|
1639
|
+
return ptr;
|
|
1640
|
+
}
|
|
1641
|
+
free() {
|
|
1642
|
+
const ptr = this.__destroy_into_raw();
|
|
1643
|
+
wasm.__wbg_funding_free(ptr);
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* @returns {any}
|
|
1647
|
+
*/
|
|
1648
|
+
jsValue() {
|
|
1649
|
+
try {
|
|
1650
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1651
|
+
wasm.funding_jsValue(retptr, this.__wbg_ptr);
|
|
1652
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1653
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1654
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1655
|
+
if (r2) {
|
|
1656
|
+
throw takeObject(r1);
|
|
1657
|
+
}
|
|
1658
|
+
return takeObject(r0);
|
|
1659
|
+
}
|
|
1660
|
+
finally {
|
|
1661
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1662
|
+
}
|
|
1663
|
+
}
|
|
1664
|
+
/**
|
|
1665
|
+
* @param {ZkLinkSigner} signer
|
|
1666
|
+
* @returns {any}
|
|
1667
|
+
*/
|
|
1668
|
+
sign(signer) {
|
|
1669
|
+
try {
|
|
1670
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1671
|
+
_assertClass(signer, ZkLinkSigner);
|
|
1672
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
1673
|
+
wasm.funding_sign(retptr, this.__wbg_ptr, ptr0);
|
|
1674
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1675
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1676
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1677
|
+
if (r2) {
|
|
1678
|
+
throw takeObject(r1);
|
|
1679
|
+
}
|
|
1680
|
+
return takeObject(r0);
|
|
1681
|
+
}
|
|
1682
|
+
finally {
|
|
1683
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1687
|
+
const FundingBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1688
|
+
? { register: () => { }, unregister: () => { } }
|
|
1689
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fundingbuilder_free(ptr >>> 0));
|
|
1690
|
+
/**
|
|
1691
|
+
*/
|
|
1692
|
+
export class FundingBuilder {
|
|
1693
|
+
__destroy_into_raw() {
|
|
1694
|
+
const ptr = this.__wbg_ptr;
|
|
1695
|
+
this.__wbg_ptr = 0;
|
|
1696
|
+
FundingBuilderFinalization.unregister(this);
|
|
1697
|
+
return ptr;
|
|
1698
|
+
}
|
|
1699
|
+
free() {
|
|
1700
|
+
const ptr = this.__destroy_into_raw();
|
|
1701
|
+
wasm.__wbg_fundingbuilder_free(ptr);
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* @param {number} account_id
|
|
1705
|
+
* @param {number} sub_account_id
|
|
1706
|
+
* @param {number} sub_account_nonce
|
|
1707
|
+
* @param {Uint32Array} funding_account_ids
|
|
1708
|
+
* @param {string} fee
|
|
1709
|
+
* @param {number} fee_token
|
|
1710
|
+
*/
|
|
1711
|
+
constructor(account_id, sub_account_id, sub_account_nonce, funding_account_ids, fee, fee_token) {
|
|
1712
|
+
try {
|
|
1713
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1714
|
+
const ptr0 = passArray32ToWasm0(funding_account_ids, wasm.__wbindgen_export_0);
|
|
1715
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1716
|
+
const ptr1 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1717
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1718
|
+
wasm.fundingbuilder_new(retptr, account_id, sub_account_id, sub_account_nonce, ptr0, len0, ptr1, len1, fee_token);
|
|
1719
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1720
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1721
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1722
|
+
if (r2) {
|
|
1723
|
+
throw takeObject(r1);
|
|
1724
|
+
}
|
|
1725
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1726
|
+
return this;
|
|
1727
|
+
}
|
|
1728
|
+
finally {
|
|
1729
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
/**
|
|
1733
|
+
* @returns {Funding}
|
|
1734
|
+
*/
|
|
1735
|
+
build() {
|
|
1736
|
+
const ptr = this.__destroy_into_raw();
|
|
1737
|
+
const ret = wasm.fundingbuilder_build(ptr);
|
|
1738
|
+
return Funding.__wrap(ret);
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
const FundingInfoFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1742
|
+
? { register: () => { }, unregister: () => { } }
|
|
1743
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_fundinginfo_free(ptr >>> 0));
|
|
1744
|
+
/**
|
|
1745
|
+
*/
|
|
1746
|
+
export class FundingInfo {
|
|
1747
|
+
__destroy_into_raw() {
|
|
1748
|
+
const ptr = this.__wbg_ptr;
|
|
1749
|
+
this.__wbg_ptr = 0;
|
|
1750
|
+
FundingInfoFinalization.unregister(this);
|
|
1751
|
+
return ptr;
|
|
1752
|
+
}
|
|
1753
|
+
free() {
|
|
1754
|
+
const ptr = this.__destroy_into_raw();
|
|
1755
|
+
wasm.__wbg_fundinginfo_free(ptr);
|
|
1756
|
+
}
|
|
1757
|
+
/**
|
|
1758
|
+
* @param {number} pair_id
|
|
1759
|
+
* @param {number} funding_rate
|
|
1760
|
+
* @param {string} price
|
|
1761
|
+
*/
|
|
1762
|
+
constructor(pair_id, funding_rate, price) {
|
|
1763
|
+
try {
|
|
1764
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1765
|
+
const ptr0 = passStringToWasm0(price, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1766
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1767
|
+
wasm.fundinginfo_new(retptr, pair_id, funding_rate, ptr0, len0);
|
|
1768
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1769
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1770
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1771
|
+
if (r2) {
|
|
1772
|
+
throw takeObject(r1);
|
|
1773
|
+
}
|
|
1774
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
1775
|
+
return this;
|
|
1776
|
+
}
|
|
1777
|
+
finally {
|
|
1778
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
/**
|
|
1782
|
+
* @returns {any}
|
|
1783
|
+
*/
|
|
1784
|
+
jsValue() {
|
|
1785
|
+
try {
|
|
1786
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1787
|
+
wasm.fundinginfo_jsValue(retptr, this.__wbg_ptr);
|
|
1788
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1789
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1790
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1791
|
+
if (r2) {
|
|
1792
|
+
throw takeObject(r1);
|
|
1793
|
+
}
|
|
1794
|
+
return takeObject(r0);
|
|
1795
|
+
}
|
|
1796
|
+
finally {
|
|
1797
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
const JsonRpcSignerFinalization = typeof FinalizationRegistry === 'undefined'
|
|
1802
|
+
? { register: () => { }, unregister: () => { } }
|
|
1803
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_jsonrpcsigner_free(ptr >>> 0));
|
|
1804
|
+
/**
|
|
1805
|
+
*/
|
|
1806
|
+
export class JsonRpcSigner {
|
|
1807
|
+
static __wrap(ptr) {
|
|
1808
|
+
ptr = ptr >>> 0;
|
|
1809
|
+
const obj = Object.create(JsonRpcSigner.prototype);
|
|
1810
|
+
obj.__wbg_ptr = ptr;
|
|
1811
|
+
JsonRpcSignerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1812
|
+
return obj;
|
|
1813
|
+
}
|
|
1814
|
+
__destroy_into_raw() {
|
|
1815
|
+
const ptr = this.__wbg_ptr;
|
|
1816
|
+
this.__wbg_ptr = 0;
|
|
1817
|
+
JsonRpcSignerFinalization.unregister(this);
|
|
1818
|
+
return ptr;
|
|
1819
|
+
}
|
|
1820
|
+
free() {
|
|
1821
|
+
const ptr = this.__destroy_into_raw();
|
|
1822
|
+
wasm.__wbg_jsonrpcsigner_free(ptr);
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* @param {string | undefined} [signature]
|
|
1826
|
+
* @returns {Promise<void>}
|
|
1827
|
+
*/
|
|
1828
|
+
initZklinkSigner(signature) {
|
|
1829
|
+
var ptr0 = isLikeNone(signature)
|
|
1830
|
+
? 0
|
|
1831
|
+
: passStringToWasm0(signature, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1832
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1833
|
+
const ret = wasm.jsonrpcsigner_initZklinkSigner(this.__wbg_ptr, ptr0, len0);
|
|
1834
|
+
return takeObject(ret);
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* @returns {string}
|
|
1838
|
+
*/
|
|
1839
|
+
getPubkey() {
|
|
1840
|
+
let deferred1_0;
|
|
1841
|
+
let deferred1_1;
|
|
1842
|
+
try {
|
|
1843
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1844
|
+
wasm.jsonrpcsigner_getPubkey(retptr, this.__wbg_ptr);
|
|
1845
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1846
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1847
|
+
deferred1_0 = r0;
|
|
1848
|
+
deferred1_1 = r1;
|
|
1849
|
+
return getStringFromWasm0(r0, r1);
|
|
1850
|
+
}
|
|
1851
|
+
finally {
|
|
1852
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1853
|
+
wasm.__wbindgen_export_5(deferred1_0, deferred1_1, 1);
|
|
1854
|
+
}
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* @returns {string}
|
|
1858
|
+
*/
|
|
1859
|
+
pubkeyHash() {
|
|
1860
|
+
let deferred1_0;
|
|
1861
|
+
let deferred1_1;
|
|
1862
|
+
try {
|
|
1863
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1864
|
+
wasm.jsonrpcsigner_pubkeyHash(retptr, this.__wbg_ptr);
|
|
1865
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1866
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1867
|
+
deferred1_0 = r0;
|
|
1868
|
+
deferred1_1 = r1;
|
|
1869
|
+
return getStringFromWasm0(r0, r1);
|
|
1870
|
+
}
|
|
1871
|
+
finally {
|
|
1872
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1873
|
+
wasm.__wbindgen_export_5(deferred1_0, deferred1_1, 1);
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
/**
|
|
1877
|
+
* @returns {string | undefined}
|
|
1878
|
+
*/
|
|
1879
|
+
address() {
|
|
1880
|
+
try {
|
|
1881
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1882
|
+
wasm.jsonrpcsigner_address(retptr, this.__wbg_ptr);
|
|
1883
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1884
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1885
|
+
let v1;
|
|
1886
|
+
if (r0 !== 0) {
|
|
1887
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
1888
|
+
wasm.__wbindgen_export_5(r0, r1 * 1, 1);
|
|
1889
|
+
}
|
|
1890
|
+
return v1;
|
|
1891
|
+
}
|
|
1892
|
+
finally {
|
|
1893
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
/**
|
|
1897
|
+
* @returns {string}
|
|
1898
|
+
*/
|
|
1899
|
+
signatureSeed() {
|
|
1900
|
+
let deferred1_0;
|
|
1901
|
+
let deferred1_1;
|
|
1902
|
+
try {
|
|
1903
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1904
|
+
wasm.jsonrpcsigner_signatureSeed(retptr, this.__wbg_ptr);
|
|
1905
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1906
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1907
|
+
deferred1_0 = r0;
|
|
1908
|
+
deferred1_1 = r1;
|
|
1909
|
+
return getStringFromWasm0(r0, r1);
|
|
1910
|
+
}
|
|
1911
|
+
finally {
|
|
1912
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1913
|
+
wasm.__wbindgen_export_5(deferred1_0, deferred1_1, 1);
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
* @param {ChangePubKey} tx
|
|
1918
|
+
* @returns {any}
|
|
1919
|
+
*/
|
|
1920
|
+
signChangePubkeyWithOnchain(tx) {
|
|
1921
|
+
try {
|
|
1922
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1923
|
+
_assertClass(tx, ChangePubKey);
|
|
1924
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
1925
|
+
wasm.jsonrpcsigner_signChangePubkeyWithOnchain(retptr, this.__wbg_ptr, ptr0);
|
|
1926
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1927
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1928
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1929
|
+
if (r2) {
|
|
1930
|
+
throw takeObject(r1);
|
|
1931
|
+
}
|
|
1932
|
+
return takeObject(r0);
|
|
1933
|
+
}
|
|
1934
|
+
finally {
|
|
1935
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
/**
|
|
1939
|
+
* @param {ChangePubKey} tx
|
|
1940
|
+
* @returns {Promise<any>}
|
|
1941
|
+
*/
|
|
1942
|
+
signChangePubkeyWithEthEcdsaAuth(tx) {
|
|
1943
|
+
_assertClass(tx, ChangePubKey);
|
|
1944
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
1945
|
+
const ret = wasm.jsonrpcsigner_signChangePubkeyWithEthEcdsaAuth(this.__wbg_ptr, ptr0);
|
|
1946
|
+
return takeObject(ret);
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* @param {ChangePubKey} tx
|
|
1950
|
+
* @param {Create2Data} create2_data
|
|
1951
|
+
* @returns {any}
|
|
1952
|
+
*/
|
|
1953
|
+
signChangePubkeyWithCreate2DataAuth(tx, create2_data) {
|
|
1954
|
+
try {
|
|
1955
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1956
|
+
_assertClass(tx, ChangePubKey);
|
|
1957
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
1958
|
+
_assertClass(create2_data, Create2Data);
|
|
1959
|
+
var ptr1 = create2_data.__destroy_into_raw();
|
|
1960
|
+
wasm.jsonrpcsigner_signChangePubkeyWithCreate2DataAuth(retptr, this.__wbg_ptr, ptr0, ptr1);
|
|
1961
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1962
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1963
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1964
|
+
if (r2) {
|
|
1965
|
+
throw takeObject(r1);
|
|
1966
|
+
}
|
|
1967
|
+
return takeObject(r0);
|
|
1968
|
+
}
|
|
1969
|
+
finally {
|
|
1970
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
/**
|
|
1974
|
+
* @param {Transfer} tx
|
|
1975
|
+
* @param {string} token_symbol
|
|
1976
|
+
* @returns {Promise<any>}
|
|
1977
|
+
*/
|
|
1978
|
+
signTransfer(tx, token_symbol) {
|
|
1979
|
+
_assertClass(tx, Transfer);
|
|
1980
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
1981
|
+
const ptr1 = passStringToWasm0(token_symbol, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
1982
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1983
|
+
const ret = wasm.jsonrpcsigner_signTransfer(this.__wbg_ptr, ptr0, ptr1, len1);
|
|
1984
|
+
return takeObject(ret);
|
|
1985
|
+
}
|
|
1986
|
+
/**
|
|
1987
|
+
* @param {Order} order
|
|
1988
|
+
* @returns {any}
|
|
1989
|
+
*/
|
|
1990
|
+
createSignedOrder(order) {
|
|
1991
|
+
try {
|
|
1992
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1993
|
+
_assertClass(order, Order);
|
|
1994
|
+
var ptr0 = order.__destroy_into_raw();
|
|
1995
|
+
wasm.jsonrpcsigner_createSignedOrder(retptr, this.__wbg_ptr, ptr0);
|
|
1996
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
1997
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
1998
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
1999
|
+
if (r2) {
|
|
2000
|
+
throw takeObject(r1);
|
|
2001
|
+
}
|
|
2002
|
+
return takeObject(r0);
|
|
2003
|
+
}
|
|
2004
|
+
finally {
|
|
2005
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2006
|
+
}
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* @param {OrderMatching} tx
|
|
2010
|
+
* @returns {any}
|
|
2011
|
+
*/
|
|
2012
|
+
signOrderMatching(tx) {
|
|
2013
|
+
try {
|
|
2014
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2015
|
+
_assertClass(tx, OrderMatching);
|
|
2016
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
2017
|
+
wasm.jsonrpcsigner_signOrderMatching(retptr, this.__wbg_ptr, ptr0);
|
|
2018
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2019
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2020
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2021
|
+
if (r2) {
|
|
2022
|
+
throw takeObject(r1);
|
|
2023
|
+
}
|
|
2024
|
+
return takeObject(r0);
|
|
2025
|
+
}
|
|
2026
|
+
finally {
|
|
2027
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2028
|
+
}
|
|
2029
|
+
}
|
|
2030
|
+
/**
|
|
2031
|
+
* @param {Withdraw} tx
|
|
2032
|
+
* @param {string} token_symbol
|
|
2033
|
+
* @returns {Promise<any>}
|
|
2034
|
+
*/
|
|
2035
|
+
signWithdraw(tx, token_symbol) {
|
|
2036
|
+
_assertClass(tx, Withdraw);
|
|
2037
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
2038
|
+
const ptr1 = passStringToWasm0(token_symbol, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2039
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2040
|
+
const ret = wasm.jsonrpcsigner_signWithdraw(this.__wbg_ptr, ptr0, ptr1, len1);
|
|
2041
|
+
return takeObject(ret);
|
|
2042
|
+
}
|
|
2043
|
+
/**
|
|
2044
|
+
* @param {ForcedExit} tx
|
|
2045
|
+
* @returns {any}
|
|
2046
|
+
*/
|
|
2047
|
+
signForcedExit(tx) {
|
|
2048
|
+
try {
|
|
2049
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2050
|
+
_assertClass(tx, ForcedExit);
|
|
2051
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
2052
|
+
wasm.jsonrpcsigner_signForcedExit(retptr, this.__wbg_ptr, ptr0);
|
|
2053
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2054
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2055
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2056
|
+
if (r2) {
|
|
2057
|
+
throw takeObject(r1);
|
|
2058
|
+
}
|
|
2059
|
+
return takeObject(r0);
|
|
2060
|
+
}
|
|
2061
|
+
finally {
|
|
2062
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2063
|
+
}
|
|
2064
|
+
}
|
|
2065
|
+
/**
|
|
2066
|
+
* @param {AutoDeleveraging} tx
|
|
2067
|
+
* @returns {any}
|
|
2068
|
+
*/
|
|
2069
|
+
signAutoDeleveraging(tx) {
|
|
2070
|
+
try {
|
|
2071
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2072
|
+
_assertClass(tx, AutoDeleveraging);
|
|
2073
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
2074
|
+
wasm.jsonrpcsigner_signAutoDeleveraging(retptr, this.__wbg_ptr, ptr0);
|
|
2075
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2076
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2077
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2078
|
+
if (r2) {
|
|
2079
|
+
throw takeObject(r1);
|
|
2080
|
+
}
|
|
2081
|
+
return takeObject(r0);
|
|
2082
|
+
}
|
|
2083
|
+
finally {
|
|
2084
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
/**
|
|
2088
|
+
* @param {Contract} contract
|
|
2089
|
+
* @returns {any}
|
|
2090
|
+
*/
|
|
2091
|
+
createSignedContract(contract) {
|
|
2092
|
+
try {
|
|
2093
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2094
|
+
_assertClass(contract, Contract);
|
|
2095
|
+
var ptr0 = contract.__destroy_into_raw();
|
|
2096
|
+
wasm.jsonrpcsigner_createSignedContract(retptr, this.__wbg_ptr, ptr0);
|
|
2097
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2098
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2099
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2100
|
+
if (r2) {
|
|
2101
|
+
throw takeObject(r1);
|
|
2102
|
+
}
|
|
2103
|
+
return takeObject(r0);
|
|
2104
|
+
}
|
|
2105
|
+
finally {
|
|
2106
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2107
|
+
}
|
|
2108
|
+
}
|
|
2109
|
+
/**
|
|
2110
|
+
* @param {ContractMatching} tx
|
|
2111
|
+
* @returns {any}
|
|
2112
|
+
*/
|
|
2113
|
+
signContractMatching(tx) {
|
|
2114
|
+
try {
|
|
2115
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2116
|
+
_assertClass(tx, ContractMatching);
|
|
2117
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
2118
|
+
wasm.jsonrpcsigner_signContractMatching(retptr, this.__wbg_ptr, ptr0);
|
|
2119
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2120
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2121
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2122
|
+
if (r2) {
|
|
2123
|
+
throw takeObject(r1);
|
|
2124
|
+
}
|
|
2125
|
+
return takeObject(r0);
|
|
2126
|
+
}
|
|
2127
|
+
finally {
|
|
2128
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2129
|
+
}
|
|
2130
|
+
}
|
|
2131
|
+
/**
|
|
2132
|
+
* @param {Funding} tx
|
|
2133
|
+
* @returns {any}
|
|
2134
|
+
*/
|
|
2135
|
+
signFunding(tx) {
|
|
2136
|
+
try {
|
|
2137
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2138
|
+
_assertClass(tx, Funding);
|
|
2139
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
2140
|
+
wasm.jsonrpcsigner_signFunding(retptr, this.__wbg_ptr, ptr0);
|
|
2141
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2142
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2143
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2144
|
+
if (r2) {
|
|
2145
|
+
throw takeObject(r1);
|
|
2146
|
+
}
|
|
2147
|
+
return takeObject(r0);
|
|
2148
|
+
}
|
|
2149
|
+
finally {
|
|
2150
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2151
|
+
}
|
|
2152
|
+
}
|
|
2153
|
+
/**
|
|
2154
|
+
* @param {Liquidation} tx
|
|
2155
|
+
* @returns {any}
|
|
2156
|
+
*/
|
|
2157
|
+
signLiquidation(tx) {
|
|
2158
|
+
try {
|
|
2159
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2160
|
+
_assertClass(tx, Liquidation);
|
|
2161
|
+
var ptr0 = tx.__destroy_into_raw();
|
|
2162
|
+
wasm.jsonrpcsigner_signLiquidation(retptr, this.__wbg_ptr, ptr0);
|
|
2163
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2164
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2165
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2166
|
+
if (r2) {
|
|
2167
|
+
throw takeObject(r1);
|
|
2168
|
+
}
|
|
2169
|
+
return takeObject(r0);
|
|
2170
|
+
}
|
|
2171
|
+
finally {
|
|
2172
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2173
|
+
}
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* @param {Uint8Array} msg
|
|
2177
|
+
* @returns {TxZkLinkSignature}
|
|
2178
|
+
*/
|
|
2179
|
+
signMusig(msg) {
|
|
2180
|
+
try {
|
|
2181
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2182
|
+
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_export_0);
|
|
2183
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2184
|
+
wasm.jsonrpcsigner_signMusig(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2185
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2186
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2187
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2188
|
+
if (r2) {
|
|
2189
|
+
throw takeObject(r1);
|
|
2190
|
+
}
|
|
2191
|
+
return TxZkLinkSignature.__wrap(r0);
|
|
2192
|
+
}
|
|
2193
|
+
finally {
|
|
2194
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
/**
|
|
2198
|
+
* @returns {ZkLinkSigner}
|
|
2199
|
+
*/
|
|
2200
|
+
getZkLinkSigner() {
|
|
2201
|
+
const ret = wasm.jsonrpcsigner_getZkLinkSigner(this.__wbg_ptr);
|
|
2202
|
+
return ZkLinkSigner.__wrap(ret);
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
const LiquidationFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2206
|
+
? { register: () => { }, unregister: () => { } }
|
|
2207
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_liquidation_free(ptr >>> 0));
|
|
2208
|
+
/**
|
|
2209
|
+
*/
|
|
2210
|
+
export class Liquidation {
|
|
2211
|
+
static __wrap(ptr) {
|
|
2212
|
+
ptr = ptr >>> 0;
|
|
2213
|
+
const obj = Object.create(Liquidation.prototype);
|
|
2214
|
+
obj.__wbg_ptr = ptr;
|
|
2215
|
+
LiquidationFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2216
|
+
return obj;
|
|
2217
|
+
}
|
|
2218
|
+
__destroy_into_raw() {
|
|
2219
|
+
const ptr = this.__wbg_ptr;
|
|
2220
|
+
this.__wbg_ptr = 0;
|
|
2221
|
+
LiquidationFinalization.unregister(this);
|
|
2222
|
+
return ptr;
|
|
2223
|
+
}
|
|
2224
|
+
free() {
|
|
2225
|
+
const ptr = this.__destroy_into_raw();
|
|
2226
|
+
wasm.__wbg_liquidation_free(ptr);
|
|
2227
|
+
}
|
|
2228
|
+
/**
|
|
2229
|
+
* @returns {any}
|
|
2230
|
+
*/
|
|
2231
|
+
jsValue() {
|
|
2232
|
+
try {
|
|
2233
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2234
|
+
wasm.liquidation_jsValue(retptr, this.__wbg_ptr);
|
|
2235
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2236
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2237
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2238
|
+
if (r2) {
|
|
2239
|
+
throw takeObject(r1);
|
|
2240
|
+
}
|
|
2241
|
+
return takeObject(r0);
|
|
2242
|
+
}
|
|
2243
|
+
finally {
|
|
2244
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
/**
|
|
2248
|
+
* @param {ZkLinkSigner} signer
|
|
2249
|
+
* @returns {any}
|
|
2250
|
+
*/
|
|
2251
|
+
sign(signer) {
|
|
2252
|
+
try {
|
|
2253
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2254
|
+
_assertClass(signer, ZkLinkSigner);
|
|
2255
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
2256
|
+
wasm.liquidation_sign(retptr, this.__wbg_ptr, ptr0);
|
|
2257
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2258
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2259
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2260
|
+
if (r2) {
|
|
2261
|
+
throw takeObject(r1);
|
|
2262
|
+
}
|
|
2263
|
+
return takeObject(r0);
|
|
2264
|
+
}
|
|
2265
|
+
finally {
|
|
2266
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2267
|
+
}
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
const LiquidationBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2271
|
+
? { register: () => { }, unregister: () => { } }
|
|
2272
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_liquidationbuilder_free(ptr >>> 0));
|
|
2273
|
+
/**
|
|
2274
|
+
*/
|
|
2275
|
+
export class LiquidationBuilder {
|
|
2276
|
+
__destroy_into_raw() {
|
|
2277
|
+
const ptr = this.__wbg_ptr;
|
|
2278
|
+
this.__wbg_ptr = 0;
|
|
2279
|
+
LiquidationBuilderFinalization.unregister(this);
|
|
2280
|
+
return ptr;
|
|
2281
|
+
}
|
|
2282
|
+
free() {
|
|
2283
|
+
const ptr = this.__destroy_into_raw();
|
|
2284
|
+
wasm.__wbg_liquidationbuilder_free(ptr);
|
|
2285
|
+
}
|
|
2286
|
+
/**
|
|
2287
|
+
* @param {number} account_id
|
|
2288
|
+
* @param {number} sub_account_id
|
|
2289
|
+
* @param {number} sub_account_nonce
|
|
2290
|
+
* @param {any[]} contract_prices
|
|
2291
|
+
* @param {any[]} margin_prices
|
|
2292
|
+
* @param {number} liquidation_account_id
|
|
2293
|
+
* @param {string} fee
|
|
2294
|
+
* @param {number} fee_token
|
|
2295
|
+
*/
|
|
2296
|
+
constructor(account_id, sub_account_id, sub_account_nonce, contract_prices, margin_prices, liquidation_account_id, fee, fee_token) {
|
|
2297
|
+
try {
|
|
2298
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2299
|
+
const ptr0 = passArrayJsValueToWasm0(contract_prices, wasm.__wbindgen_export_0);
|
|
2300
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2301
|
+
const ptr1 = passArrayJsValueToWasm0(margin_prices, wasm.__wbindgen_export_0);
|
|
2302
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2303
|
+
const ptr2 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2304
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2305
|
+
wasm.liquidationbuilder_new(retptr, account_id, sub_account_id, sub_account_nonce, ptr0, len0, ptr1, len1, liquidation_account_id, ptr2, len2, fee_token);
|
|
2306
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2307
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2308
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2309
|
+
if (r2) {
|
|
2310
|
+
throw takeObject(r1);
|
|
2311
|
+
}
|
|
2312
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
2313
|
+
return this;
|
|
2314
|
+
}
|
|
2315
|
+
finally {
|
|
2316
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2317
|
+
}
|
|
2318
|
+
}
|
|
2319
|
+
/**
|
|
2320
|
+
* @returns {Liquidation}
|
|
2321
|
+
*/
|
|
2322
|
+
build() {
|
|
2323
|
+
const ptr = this.__destroy_into_raw();
|
|
2324
|
+
const ret = wasm.liquidationbuilder_build(ptr);
|
|
2325
|
+
return Liquidation.__wrap(ret);
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
const MarginInfoFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2329
|
+
? { register: () => { }, unregister: () => { } }
|
|
2330
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_margininfo_free(ptr >>> 0));
|
|
2331
|
+
/**
|
|
2332
|
+
*/
|
|
2333
|
+
export class MarginInfo {
|
|
2334
|
+
__destroy_into_raw() {
|
|
2335
|
+
const ptr = this.__wbg_ptr;
|
|
2336
|
+
this.__wbg_ptr = 0;
|
|
2337
|
+
MarginInfoFinalization.unregister(this);
|
|
2338
|
+
return ptr;
|
|
2339
|
+
}
|
|
2340
|
+
free() {
|
|
2341
|
+
const ptr = this.__destroy_into_raw();
|
|
2342
|
+
wasm.__wbg_margininfo_free(ptr);
|
|
2343
|
+
}
|
|
2344
|
+
/**
|
|
2345
|
+
* @param {number} margin_id
|
|
2346
|
+
* @param {number} token_id
|
|
2347
|
+
* @param {number} ratio
|
|
2348
|
+
*/
|
|
2349
|
+
constructor(margin_id, token_id, ratio) {
|
|
2350
|
+
const ret = wasm.margininfo_new(margin_id, token_id, ratio);
|
|
2351
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2352
|
+
return this;
|
|
2353
|
+
}
|
|
2354
|
+
/**
|
|
2355
|
+
* @returns {any}
|
|
2356
|
+
*/
|
|
2357
|
+
jsValue() {
|
|
2358
|
+
try {
|
|
2359
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2360
|
+
wasm.margininfo_jsValue(retptr, this.__wbg_ptr);
|
|
2361
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2362
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2363
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2364
|
+
if (r2) {
|
|
2365
|
+
throw takeObject(r1);
|
|
2366
|
+
}
|
|
2367
|
+
return takeObject(r0);
|
|
2368
|
+
}
|
|
2369
|
+
finally {
|
|
2370
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
}
|
|
2374
|
+
const OrderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2375
|
+
? { register: () => { }, unregister: () => { } }
|
|
2376
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_order_free(ptr >>> 0));
|
|
2377
|
+
/**
|
|
2378
|
+
*/
|
|
2379
|
+
export class Order {
|
|
2380
|
+
__destroy_into_raw() {
|
|
2381
|
+
const ptr = this.__wbg_ptr;
|
|
2382
|
+
this.__wbg_ptr = 0;
|
|
2383
|
+
OrderFinalization.unregister(this);
|
|
2384
|
+
return ptr;
|
|
2385
|
+
}
|
|
2386
|
+
free() {
|
|
2387
|
+
const ptr = this.__destroy_into_raw();
|
|
2388
|
+
wasm.__wbg_order_free(ptr);
|
|
2389
|
+
}
|
|
2390
|
+
/**
|
|
2391
|
+
* @param {number} account_id
|
|
2392
|
+
* @param {number} sub_account_id
|
|
2393
|
+
* @param {number} slot_id
|
|
2394
|
+
* @param {number} nonce
|
|
2395
|
+
* @param {number} base_token_id
|
|
2396
|
+
* @param {number} quote_token_id
|
|
2397
|
+
* @param {string} amount
|
|
2398
|
+
* @param {string} price
|
|
2399
|
+
* @param {boolean} is_sell
|
|
2400
|
+
* @param {number} maker_fee_rate
|
|
2401
|
+
* @param {number} taker_fee_rate
|
|
2402
|
+
* @param {boolean} has_subsidy
|
|
2403
|
+
*/
|
|
2404
|
+
constructor(account_id, sub_account_id, slot_id, nonce, base_token_id, quote_token_id, amount, price, is_sell, maker_fee_rate, taker_fee_rate, has_subsidy) {
|
|
2405
|
+
try {
|
|
2406
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2407
|
+
const ptr0 = passStringToWasm0(amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2408
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2409
|
+
const ptr1 = passStringToWasm0(price, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2410
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2411
|
+
wasm.order_new(retptr, account_id, sub_account_id, slot_id, nonce, base_token_id, quote_token_id, ptr0, len0, ptr1, len1, is_sell, maker_fee_rate, taker_fee_rate, has_subsidy);
|
|
2412
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2413
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2414
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2415
|
+
if (r2) {
|
|
2416
|
+
throw takeObject(r1);
|
|
2417
|
+
}
|
|
2418
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
2419
|
+
return this;
|
|
2420
|
+
}
|
|
2421
|
+
finally {
|
|
2422
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2423
|
+
}
|
|
2424
|
+
}
|
|
2425
|
+
/**
|
|
2426
|
+
* @returns {any}
|
|
2427
|
+
*/
|
|
2428
|
+
jsValue() {
|
|
2429
|
+
try {
|
|
2430
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2431
|
+
wasm.order_jsValue(retptr, this.__wbg_ptr);
|
|
2432
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2433
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2434
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2435
|
+
if (r2) {
|
|
2436
|
+
throw takeObject(r1);
|
|
2437
|
+
}
|
|
2438
|
+
return takeObject(r0);
|
|
2439
|
+
}
|
|
2440
|
+
finally {
|
|
2441
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
/**
|
|
2445
|
+
* @param {ZkLinkSigner} signer
|
|
2446
|
+
* @returns {any}
|
|
2447
|
+
*/
|
|
2448
|
+
sign(signer) {
|
|
2449
|
+
try {
|
|
2450
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2451
|
+
_assertClass(signer, ZkLinkSigner);
|
|
2452
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
2453
|
+
wasm.order_sign(retptr, this.__wbg_ptr, ptr0);
|
|
2454
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2455
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2456
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2457
|
+
if (r2) {
|
|
2458
|
+
throw takeObject(r1);
|
|
2459
|
+
}
|
|
2460
|
+
return takeObject(r0);
|
|
2461
|
+
}
|
|
2462
|
+
finally {
|
|
2463
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2464
|
+
}
|
|
2465
|
+
}
|
|
2466
|
+
}
|
|
2467
|
+
const OrderMatchingFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2468
|
+
? { register: () => { }, unregister: () => { } }
|
|
2469
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ordermatching_free(ptr >>> 0));
|
|
2470
|
+
/**
|
|
2471
|
+
*/
|
|
2472
|
+
export class OrderMatching {
|
|
2473
|
+
static __wrap(ptr) {
|
|
2474
|
+
ptr = ptr >>> 0;
|
|
2475
|
+
const obj = Object.create(OrderMatching.prototype);
|
|
2476
|
+
obj.__wbg_ptr = ptr;
|
|
2477
|
+
OrderMatchingFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2478
|
+
return obj;
|
|
2479
|
+
}
|
|
2480
|
+
__destroy_into_raw() {
|
|
2481
|
+
const ptr = this.__wbg_ptr;
|
|
2482
|
+
this.__wbg_ptr = 0;
|
|
2483
|
+
OrderMatchingFinalization.unregister(this);
|
|
2484
|
+
return ptr;
|
|
2485
|
+
}
|
|
2486
|
+
free() {
|
|
2487
|
+
const ptr = this.__destroy_into_raw();
|
|
2488
|
+
wasm.__wbg_ordermatching_free(ptr);
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* @returns {any}
|
|
2492
|
+
*/
|
|
2493
|
+
jsValue() {
|
|
2494
|
+
try {
|
|
2495
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2496
|
+
wasm.ordermatching_jsValue(retptr, this.__wbg_ptr);
|
|
2497
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2498
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2499
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2500
|
+
if (r2) {
|
|
2501
|
+
throw takeObject(r1);
|
|
2502
|
+
}
|
|
2503
|
+
return takeObject(r0);
|
|
2504
|
+
}
|
|
2505
|
+
finally {
|
|
2506
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
const OrderMatchingBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2511
|
+
? { register: () => { }, unregister: () => { } }
|
|
2512
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ordermatchingbuilder_free(ptr >>> 0));
|
|
2513
|
+
/**
|
|
2514
|
+
*/
|
|
2515
|
+
export class OrderMatchingBuilder {
|
|
2516
|
+
__destroy_into_raw() {
|
|
2517
|
+
const ptr = this.__wbg_ptr;
|
|
2518
|
+
this.__wbg_ptr = 0;
|
|
2519
|
+
OrderMatchingBuilderFinalization.unregister(this);
|
|
2520
|
+
return ptr;
|
|
2521
|
+
}
|
|
2522
|
+
free() {
|
|
2523
|
+
const ptr = this.__destroy_into_raw();
|
|
2524
|
+
wasm.__wbg_ordermatchingbuilder_free(ptr);
|
|
2525
|
+
}
|
|
2526
|
+
/**
|
|
2527
|
+
* @param {number} account_id
|
|
2528
|
+
* @param {number} sub_account_id
|
|
2529
|
+
* @param {any} taker
|
|
2530
|
+
* @param {any} maker
|
|
2531
|
+
* @param {string} fee
|
|
2532
|
+
* @param {number} fee_token
|
|
2533
|
+
* @param {any[]} contract_prices
|
|
2534
|
+
* @param {any[]} margin_prices
|
|
2535
|
+
* @param {string} expect_base_amount
|
|
2536
|
+
* @param {string} expect_quote_amount
|
|
2537
|
+
*/
|
|
2538
|
+
constructor(account_id, sub_account_id, taker, maker, fee, fee_token, contract_prices, margin_prices, expect_base_amount, expect_quote_amount) {
|
|
2539
|
+
try {
|
|
2540
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2541
|
+
const ptr0 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2542
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2543
|
+
const ptr1 = passArrayJsValueToWasm0(contract_prices, wasm.__wbindgen_export_0);
|
|
2544
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2545
|
+
const ptr2 = passArrayJsValueToWasm0(margin_prices, wasm.__wbindgen_export_0);
|
|
2546
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2547
|
+
const ptr3 = passStringToWasm0(expect_base_amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2548
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2549
|
+
const ptr4 = passStringToWasm0(expect_quote_amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2550
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2551
|
+
wasm.ordermatchingbuilder_new(retptr, account_id, sub_account_id, addHeapObject(taker), addHeapObject(maker), ptr0, len0, fee_token, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
2552
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2553
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2554
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2555
|
+
if (r2) {
|
|
2556
|
+
throw takeObject(r1);
|
|
2557
|
+
}
|
|
2558
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
2559
|
+
return this;
|
|
2560
|
+
}
|
|
2561
|
+
finally {
|
|
2562
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
/**
|
|
2566
|
+
* @returns {OrderMatching}
|
|
2567
|
+
*/
|
|
2568
|
+
build() {
|
|
2569
|
+
const ptr = this.__destroy_into_raw();
|
|
2570
|
+
const ret = wasm.ordermatchingbuilder_build(ptr);
|
|
2571
|
+
return OrderMatching.__wrap(ret);
|
|
2572
|
+
}
|
|
2573
|
+
}
|
|
2574
|
+
const ParameterFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2575
|
+
? { register: () => { }, unregister: () => { } }
|
|
2576
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parameter_free(ptr >>> 0));
|
|
2577
|
+
/**
|
|
2578
|
+
*/
|
|
2579
|
+
export class Parameter {
|
|
2580
|
+
__destroy_into_raw() {
|
|
2581
|
+
const ptr = this.__wbg_ptr;
|
|
2582
|
+
this.__wbg_ptr = 0;
|
|
2583
|
+
ParameterFinalization.unregister(this);
|
|
2584
|
+
return ptr;
|
|
2585
|
+
}
|
|
2586
|
+
free() {
|
|
2587
|
+
const ptr = this.__destroy_into_raw();
|
|
2588
|
+
wasm.__wbg_parameter_free(ptr);
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* @param {ParameterType} parameter_type
|
|
2592
|
+
* @param {any} parameter_value
|
|
2593
|
+
*/
|
|
2594
|
+
constructor(parameter_type, parameter_value) {
|
|
2595
|
+
const ret = wasm.parameter_new(parameter_type, addHeapObject(parameter_value));
|
|
2596
|
+
this.__wbg_ptr = ret >>> 0;
|
|
2597
|
+
return this;
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
const RequestArgumentsFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2601
|
+
? { register: () => { }, unregister: () => { } }
|
|
2602
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_requestarguments_free(ptr >>> 0));
|
|
2603
|
+
/**
|
|
2604
|
+
*/
|
|
2605
|
+
export class RequestArguments {
|
|
2606
|
+
__destroy_into_raw() {
|
|
2607
|
+
const ptr = this.__wbg_ptr;
|
|
2608
|
+
this.__wbg_ptr = 0;
|
|
2609
|
+
RequestArgumentsFinalization.unregister(this);
|
|
2610
|
+
return ptr;
|
|
2611
|
+
}
|
|
2612
|
+
free() {
|
|
2613
|
+
const ptr = this.__destroy_into_raw();
|
|
2614
|
+
wasm.__wbg_requestarguments_free(ptr);
|
|
2615
|
+
}
|
|
2616
|
+
}
|
|
2617
|
+
const RpcClientFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2618
|
+
? { register: () => { }, unregister: () => { } }
|
|
2619
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_rpcclient_free(ptr >>> 0));
|
|
2620
|
+
/**
|
|
2621
|
+
*/
|
|
2622
|
+
export class RpcClient {
|
|
2623
|
+
__destroy_into_raw() {
|
|
2624
|
+
const ptr = this.__wbg_ptr;
|
|
2625
|
+
this.__wbg_ptr = 0;
|
|
2626
|
+
RpcClientFinalization.unregister(this);
|
|
2627
|
+
return ptr;
|
|
2628
|
+
}
|
|
2629
|
+
free() {
|
|
2630
|
+
const ptr = this.__destroy_into_raw();
|
|
2631
|
+
wasm.__wbg_rpcclient_free(ptr);
|
|
2632
|
+
}
|
|
2633
|
+
/**
|
|
2634
|
+
* @param {string} network
|
|
2635
|
+
* @param {string | undefined} [custom_url]
|
|
2636
|
+
*/
|
|
2637
|
+
constructor(network, custom_url) {
|
|
2638
|
+
try {
|
|
2639
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2640
|
+
const ptr0 = passStringToWasm0(network, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2641
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2642
|
+
var ptr1 = isLikeNone(custom_url)
|
|
2643
|
+
? 0
|
|
2644
|
+
: passStringToWasm0(custom_url, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2645
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2646
|
+
wasm.rpcclient_new(retptr, ptr0, len0, ptr1, len1);
|
|
2647
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2648
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2649
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2650
|
+
if (r2) {
|
|
2651
|
+
throw takeObject(r1);
|
|
2652
|
+
}
|
|
2653
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
2654
|
+
return this;
|
|
2655
|
+
}
|
|
2656
|
+
finally {
|
|
2657
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
/**
|
|
2661
|
+
* @returns {Promise<any>}
|
|
2662
|
+
*/
|
|
2663
|
+
getSupportTokens() {
|
|
2664
|
+
const ret = wasm.rpcclient_getSupportTokens(this.__wbg_ptr);
|
|
2665
|
+
return takeObject(ret);
|
|
2666
|
+
}
|
|
2667
|
+
/**
|
|
2668
|
+
* @param {AccountQuery} account_query
|
|
2669
|
+
* @param {number | undefined} [sub_account_id]
|
|
2670
|
+
* @param {number | undefined} [block_number]
|
|
2671
|
+
* @returns {Promise<any>}
|
|
2672
|
+
*/
|
|
2673
|
+
getAccountSnapshot(account_query, sub_account_id, block_number) {
|
|
2674
|
+
_assertClass(account_query, AccountQuery);
|
|
2675
|
+
var ptr0 = account_query.__destroy_into_raw();
|
|
2676
|
+
const ret = wasm.rpcclient_getAccountSnapshot(this.__wbg_ptr, ptr0, isLikeNone(sub_account_id) ? 0xffffff : sub_account_id, !isLikeNone(block_number), isLikeNone(block_number) ? 0 : block_number);
|
|
2677
|
+
return takeObject(ret);
|
|
2678
|
+
}
|
|
2679
|
+
/**
|
|
2680
|
+
* @param {any} tx
|
|
2681
|
+
* @param {TxLayer1Signature | undefined} [l1_signature]
|
|
2682
|
+
* @param {TxZkLinkSignature | undefined} [l2_signature]
|
|
2683
|
+
* @returns {Promise<any>}
|
|
2684
|
+
*/
|
|
2685
|
+
sendTransaction(tx, l1_signature, l2_signature) {
|
|
2686
|
+
let ptr0 = 0;
|
|
2687
|
+
if (!isLikeNone(l1_signature)) {
|
|
2688
|
+
_assertClass(l1_signature, TxLayer1Signature);
|
|
2689
|
+
ptr0 = l1_signature.__destroy_into_raw();
|
|
2690
|
+
}
|
|
2691
|
+
let ptr1 = 0;
|
|
2692
|
+
if (!isLikeNone(l2_signature)) {
|
|
2693
|
+
_assertClass(l2_signature, TxZkLinkSignature);
|
|
2694
|
+
ptr1 = l2_signature.__destroy_into_raw();
|
|
2695
|
+
}
|
|
2696
|
+
const ret = wasm.rpcclient_sendTransaction(this.__wbg_ptr, addHeapObject(tx), ptr0, ptr1);
|
|
2697
|
+
return takeObject(ret);
|
|
2698
|
+
}
|
|
2699
|
+
/**
|
|
2700
|
+
* @returns {Promise<any>}
|
|
2701
|
+
*/
|
|
2702
|
+
getSupportChains() {
|
|
2703
|
+
const ret = wasm.rpcclient_getSupportChains(this.__wbg_ptr);
|
|
2704
|
+
return takeObject(ret);
|
|
2705
|
+
}
|
|
2706
|
+
/**
|
|
2707
|
+
* @returns {Promise<any>}
|
|
2708
|
+
*/
|
|
2709
|
+
getLatestBlockNumber() {
|
|
2710
|
+
const ret = wasm.rpcclient_getLatestBlockNumber(this.__wbg_ptr);
|
|
2711
|
+
return takeObject(ret);
|
|
2712
|
+
}
|
|
2713
|
+
/**
|
|
2714
|
+
* @param {number | undefined} block_number
|
|
2715
|
+
* @param {boolean} include_tx
|
|
2716
|
+
* @param {boolean} include_update
|
|
2717
|
+
* @returns {Promise<any>}
|
|
2718
|
+
*/
|
|
2719
|
+
getBlockByNumber(block_number, include_tx, include_update) {
|
|
2720
|
+
const ret = wasm.rpcclient_getBlockByNumber(this.__wbg_ptr, !isLikeNone(block_number), isLikeNone(block_number) ? 0 : block_number, include_tx, include_update);
|
|
2721
|
+
return takeObject(ret);
|
|
2722
|
+
}
|
|
2723
|
+
/**
|
|
2724
|
+
* @param {bigint} last_tx_timestamp_micro
|
|
2725
|
+
* @param {boolean} include_tx
|
|
2726
|
+
* @param {boolean} include_update
|
|
2727
|
+
* @param {number | undefined} [limit]
|
|
2728
|
+
* @returns {Promise<any>}
|
|
2729
|
+
*/
|
|
2730
|
+
getPendingBlock(last_tx_timestamp_micro, include_tx, include_update, limit) {
|
|
2731
|
+
const ret = wasm.rpcclient_getPendingBlock(this.__wbg_ptr, last_tx_timestamp_micro, include_tx, include_update, !isLikeNone(limit), isLikeNone(limit) ? 0 : limit);
|
|
2732
|
+
return takeObject(ret);
|
|
2733
|
+
}
|
|
2734
|
+
/**
|
|
2735
|
+
* @param {number} block_number
|
|
2736
|
+
* @returns {Promise<any>}
|
|
2737
|
+
*/
|
|
2738
|
+
getBlockOnChainByNumber(block_number) {
|
|
2739
|
+
const ret = wasm.rpcclient_getBlockOnChainByNumber(this.__wbg_ptr, block_number);
|
|
2740
|
+
return takeObject(ret);
|
|
2741
|
+
}
|
|
2742
|
+
/**
|
|
2743
|
+
* @param {AccountQuery} account_query
|
|
2744
|
+
* @returns {Promise<any>}
|
|
2745
|
+
*/
|
|
2746
|
+
getAccount(account_query) {
|
|
2747
|
+
_assertClass(account_query, AccountQuery);
|
|
2748
|
+
var ptr0 = account_query.__destroy_into_raw();
|
|
2749
|
+
const ret = wasm.rpcclient_getAccount(this.__wbg_ptr, ptr0);
|
|
2750
|
+
return takeObject(ret);
|
|
2751
|
+
}
|
|
2752
|
+
/**
|
|
2753
|
+
* @param {number} account_id
|
|
2754
|
+
* @param {number | undefined} [sub_account_id]
|
|
2755
|
+
* @returns {Promise<any>}
|
|
2756
|
+
*/
|
|
2757
|
+
getAccountBalances(account_id, sub_account_id) {
|
|
2758
|
+
const ret = wasm.rpcclient_getAccountBalances(this.__wbg_ptr, account_id, isLikeNone(sub_account_id) ? 0xffffff : sub_account_id);
|
|
2759
|
+
return takeObject(ret);
|
|
2760
|
+
}
|
|
2761
|
+
/**
|
|
2762
|
+
* @param {number} account_id
|
|
2763
|
+
* @param {number | undefined} [sub_account_id]
|
|
2764
|
+
* @returns {Promise<any>}
|
|
2765
|
+
*/
|
|
2766
|
+
getAccountOrderSlots(account_id, sub_account_id) {
|
|
2767
|
+
const ret = wasm.rpcclient_getAccountOrderSlots(this.__wbg_ptr, account_id, isLikeNone(sub_account_id) ? 0xffffff : sub_account_id);
|
|
2768
|
+
return takeObject(ret);
|
|
2769
|
+
}
|
|
2770
|
+
/**
|
|
2771
|
+
* @param {number} token_id
|
|
2772
|
+
* @param {boolean} mapping
|
|
2773
|
+
* @returns {Promise<any>}
|
|
2774
|
+
*/
|
|
2775
|
+
getTokenReserve(token_id, mapping) {
|
|
2776
|
+
const ret = wasm.rpcclient_getTokenReserve(this.__wbg_ptr, token_id, mapping);
|
|
2777
|
+
return takeObject(ret);
|
|
2778
|
+
}
|
|
2779
|
+
/**
|
|
2780
|
+
* @param {string} hash
|
|
2781
|
+
* @param {boolean} include_update
|
|
2782
|
+
* @returns {Promise<any>}
|
|
2783
|
+
*/
|
|
2784
|
+
getTransactionByHash(hash, include_update) {
|
|
2785
|
+
const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2786
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2787
|
+
const ret = wasm.rpcclient_getTransactionByHash(this.__wbg_ptr, ptr0, len0, include_update);
|
|
2788
|
+
return takeObject(ret);
|
|
2789
|
+
}
|
|
2790
|
+
/**
|
|
2791
|
+
* @param {ZkLinkTxType} tx_type
|
|
2792
|
+
* @param {string} address
|
|
2793
|
+
* @param {bigint} page_index
|
|
2794
|
+
* @param {number} page_size
|
|
2795
|
+
* @returns {Promise<any>}
|
|
2796
|
+
*/
|
|
2797
|
+
getAccountTransactionHistory(tx_type, address, page_index, page_size) {
|
|
2798
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2799
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2800
|
+
const ret = wasm.rpcclient_getAccountTransactionHistory(this.__wbg_ptr, tx_type, ptr0, len0, page_index, page_size);
|
|
2801
|
+
return takeObject(ret);
|
|
2802
|
+
}
|
|
2803
|
+
/**
|
|
2804
|
+
* @param {bigint} last_tx_timestamp
|
|
2805
|
+
* @param {number} max_txs
|
|
2806
|
+
* @returns {Promise<any>}
|
|
2807
|
+
*/
|
|
2808
|
+
getWithdrawTxs(last_tx_timestamp, max_txs) {
|
|
2809
|
+
const ret = wasm.rpcclient_getWithdrawTxs(this.__wbg_ptr, last_tx_timestamp, max_txs);
|
|
2810
|
+
return takeObject(ret);
|
|
2811
|
+
}
|
|
2812
|
+
/**
|
|
2813
|
+
* @param {number} sub_account_id
|
|
2814
|
+
* @param {bigint} offset_id
|
|
2815
|
+
* @param {bigint} limit
|
|
2816
|
+
* @returns {Promise<any>}
|
|
2817
|
+
*/
|
|
2818
|
+
pullForwardTxs(sub_account_id, offset_id, limit) {
|
|
2819
|
+
const ret = wasm.rpcclient_pullForwardTxs(this.__wbg_ptr, sub_account_id, offset_id, limit);
|
|
2820
|
+
return takeObject(ret);
|
|
2821
|
+
}
|
|
2822
|
+
/**
|
|
2823
|
+
* @param {string} topic
|
|
2824
|
+
* @param {number} from_topic_index_included
|
|
2825
|
+
* @param {number | undefined} [limit]
|
|
2826
|
+
* @returns {Promise<any>}
|
|
2827
|
+
*/
|
|
2828
|
+
getWebSocketEvents(topic, from_topic_index_included, limit) {
|
|
2829
|
+
const ptr0 = passStringToWasm0(topic, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2830
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2831
|
+
const ret = wasm.rpcclient_getWebSocketEvents(this.__wbg_ptr, ptr0, len0, from_topic_index_included, !isLikeNone(limit), isLikeNone(limit) ? 0 : limit);
|
|
2832
|
+
return takeObject(ret);
|
|
2833
|
+
}
|
|
2834
|
+
}
|
|
2835
|
+
const SpotPriceInfoFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2836
|
+
? { register: () => { }, unregister: () => { } }
|
|
2837
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_spotpriceinfo_free(ptr >>> 0));
|
|
2838
|
+
/**
|
|
2839
|
+
*/
|
|
2840
|
+
export class SpotPriceInfo {
|
|
2841
|
+
__destroy_into_raw() {
|
|
2842
|
+
const ptr = this.__wbg_ptr;
|
|
2843
|
+
this.__wbg_ptr = 0;
|
|
2844
|
+
SpotPriceInfoFinalization.unregister(this);
|
|
2845
|
+
return ptr;
|
|
2846
|
+
}
|
|
2847
|
+
free() {
|
|
2848
|
+
const ptr = this.__destroy_into_raw();
|
|
2849
|
+
wasm.__wbg_spotpriceinfo_free(ptr);
|
|
2850
|
+
}
|
|
2851
|
+
/**
|
|
2852
|
+
* @param {number} token_id
|
|
2853
|
+
* @param {string} price
|
|
2854
|
+
*/
|
|
2855
|
+
constructor(token_id, price) {
|
|
2856
|
+
try {
|
|
2857
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2858
|
+
const ptr0 = passStringToWasm0(price, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2859
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2860
|
+
wasm.spotpriceinfo_new(retptr, token_id, ptr0, len0);
|
|
2861
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2862
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2863
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2864
|
+
if (r2) {
|
|
2865
|
+
throw takeObject(r1);
|
|
2866
|
+
}
|
|
2867
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
2868
|
+
return this;
|
|
2869
|
+
}
|
|
2870
|
+
finally {
|
|
2871
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
/**
|
|
2875
|
+
* @returns {any}
|
|
2876
|
+
*/
|
|
2877
|
+
jsValue() {
|
|
2878
|
+
try {
|
|
2879
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2880
|
+
wasm.spotpriceinfo_jsValue(retptr, this.__wbg_ptr);
|
|
2881
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2882
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2883
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2884
|
+
if (r2) {
|
|
2885
|
+
throw takeObject(r1);
|
|
2886
|
+
}
|
|
2887
|
+
return takeObject(r0);
|
|
2888
|
+
}
|
|
2889
|
+
finally {
|
|
2890
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2891
|
+
}
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
const TransferFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2895
|
+
? { register: () => { }, unregister: () => { } }
|
|
2896
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_transfer_free(ptr >>> 0));
|
|
2897
|
+
/**
|
|
2898
|
+
*/
|
|
2899
|
+
export class Transfer {
|
|
2900
|
+
static __wrap(ptr) {
|
|
2901
|
+
ptr = ptr >>> 0;
|
|
2902
|
+
const obj = Object.create(Transfer.prototype);
|
|
2903
|
+
obj.__wbg_ptr = ptr;
|
|
2904
|
+
TransferFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2905
|
+
return obj;
|
|
2906
|
+
}
|
|
2907
|
+
__destroy_into_raw() {
|
|
2908
|
+
const ptr = this.__wbg_ptr;
|
|
2909
|
+
this.__wbg_ptr = 0;
|
|
2910
|
+
TransferFinalization.unregister(this);
|
|
2911
|
+
return ptr;
|
|
2912
|
+
}
|
|
2913
|
+
free() {
|
|
2914
|
+
const ptr = this.__destroy_into_raw();
|
|
2915
|
+
wasm.__wbg_transfer_free(ptr);
|
|
2916
|
+
}
|
|
2917
|
+
/**
|
|
2918
|
+
* @returns {any}
|
|
2919
|
+
*/
|
|
2920
|
+
jsValue() {
|
|
2921
|
+
try {
|
|
2922
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2923
|
+
wasm.transfer_jsValue(retptr, this.__wbg_ptr);
|
|
2924
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2925
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2926
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2927
|
+
if (r2) {
|
|
2928
|
+
throw takeObject(r1);
|
|
2929
|
+
}
|
|
2930
|
+
return takeObject(r0);
|
|
2931
|
+
}
|
|
2932
|
+
finally {
|
|
2933
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2934
|
+
}
|
|
2935
|
+
}
|
|
2936
|
+
/**
|
|
2937
|
+
* @param {string} token_symbol
|
|
2938
|
+
* @returns {string}
|
|
2939
|
+
*/
|
|
2940
|
+
getEthSignMsg(token_symbol) {
|
|
2941
|
+
let deferred2_0;
|
|
2942
|
+
let deferred2_1;
|
|
2943
|
+
try {
|
|
2944
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2945
|
+
const ptr0 = passStringToWasm0(token_symbol, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
2946
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2947
|
+
wasm.transfer_getEthSignMsg(retptr, this.__wbg_ptr, ptr0, len0);
|
|
2948
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2949
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2950
|
+
deferred2_0 = r0;
|
|
2951
|
+
deferred2_1 = r1;
|
|
2952
|
+
return getStringFromWasm0(r0, r1);
|
|
2953
|
+
}
|
|
2954
|
+
finally {
|
|
2955
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2956
|
+
wasm.__wbindgen_export_5(deferred2_0, deferred2_1, 1);
|
|
2957
|
+
}
|
|
2958
|
+
}
|
|
2959
|
+
/**
|
|
2960
|
+
* @param {ZkLinkSigner} signer
|
|
2961
|
+
* @returns {any}
|
|
2962
|
+
*/
|
|
2963
|
+
sign(signer) {
|
|
2964
|
+
try {
|
|
2965
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2966
|
+
_assertClass(signer, ZkLinkSigner);
|
|
2967
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
2968
|
+
wasm.transfer_sign(retptr, this.__wbg_ptr, ptr0);
|
|
2969
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
2970
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
2971
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
2972
|
+
if (r2) {
|
|
2973
|
+
throw takeObject(r1);
|
|
2974
|
+
}
|
|
2975
|
+
return takeObject(r0);
|
|
2976
|
+
}
|
|
2977
|
+
finally {
|
|
2978
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2979
|
+
}
|
|
2980
|
+
}
|
|
2981
|
+
}
|
|
2982
|
+
const TransferBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
2983
|
+
? { register: () => { }, unregister: () => { } }
|
|
2984
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_transferbuilder_free(ptr >>> 0));
|
|
2985
|
+
/**
|
|
2986
|
+
*/
|
|
2987
|
+
export class TransferBuilder {
|
|
2988
|
+
__destroy_into_raw() {
|
|
2989
|
+
const ptr = this.__wbg_ptr;
|
|
2990
|
+
this.__wbg_ptr = 0;
|
|
2991
|
+
TransferBuilderFinalization.unregister(this);
|
|
2992
|
+
return ptr;
|
|
2993
|
+
}
|
|
2994
|
+
free() {
|
|
2995
|
+
const ptr = this.__destroy_into_raw();
|
|
2996
|
+
wasm.__wbg_transferbuilder_free(ptr);
|
|
2997
|
+
}
|
|
2998
|
+
/**
|
|
2999
|
+
* @param {number} account_id
|
|
3000
|
+
* @param {string} to_address
|
|
3001
|
+
* @param {number} from_sub_account_id
|
|
3002
|
+
* @param {number} to_sub_account_id
|
|
3003
|
+
* @param {number} token
|
|
3004
|
+
* @param {string} fee
|
|
3005
|
+
* @param {string} amount
|
|
3006
|
+
* @param {number} nonce
|
|
3007
|
+
* @param {number | undefined} [ts]
|
|
3008
|
+
*/
|
|
3009
|
+
constructor(account_id, to_address, from_sub_account_id, to_sub_account_id, token, fee, amount, nonce, ts) {
|
|
3010
|
+
try {
|
|
3011
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3012
|
+
const ptr0 = passStringToWasm0(to_address, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3013
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3014
|
+
const ptr1 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3015
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3016
|
+
const ptr2 = passStringToWasm0(amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3017
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3018
|
+
wasm.transferbuilder_new(retptr, account_id, ptr0, len0, from_sub_account_id, to_sub_account_id, token, ptr1, len1, ptr2, len2, nonce, !isLikeNone(ts), isLikeNone(ts) ? 0 : ts);
|
|
3019
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3020
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3021
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3022
|
+
if (r2) {
|
|
3023
|
+
throw takeObject(r1);
|
|
3024
|
+
}
|
|
3025
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
3026
|
+
return this;
|
|
3027
|
+
}
|
|
3028
|
+
finally {
|
|
3029
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
/**
|
|
3033
|
+
* @returns {Transfer}
|
|
3034
|
+
*/
|
|
3035
|
+
build() {
|
|
3036
|
+
const ptr = this.__destroy_into_raw();
|
|
3037
|
+
const ret = wasm.transferbuilder_build(ptr);
|
|
3038
|
+
return Transfer.__wrap(ret);
|
|
3039
|
+
}
|
|
3040
|
+
}
|
|
3041
|
+
const TxLayer1SignatureFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3042
|
+
? { register: () => { }, unregister: () => { } }
|
|
3043
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_txlayer1signature_free(ptr >>> 0));
|
|
3044
|
+
/**
|
|
3045
|
+
*/
|
|
3046
|
+
export class TxLayer1Signature {
|
|
3047
|
+
__destroy_into_raw() {
|
|
3048
|
+
const ptr = this.__wbg_ptr;
|
|
3049
|
+
this.__wbg_ptr = 0;
|
|
3050
|
+
TxLayer1SignatureFinalization.unregister(this);
|
|
3051
|
+
return ptr;
|
|
3052
|
+
}
|
|
3053
|
+
free() {
|
|
3054
|
+
const ptr = this.__destroy_into_raw();
|
|
3055
|
+
wasm.__wbg_txlayer1signature_free(ptr);
|
|
3056
|
+
}
|
|
3057
|
+
/**
|
|
3058
|
+
* @param {L1SignatureType} sign_type
|
|
3059
|
+
* @param {string} signature
|
|
3060
|
+
*/
|
|
3061
|
+
constructor(sign_type, signature) {
|
|
3062
|
+
const ptr0 = passStringToWasm0(signature, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3063
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3064
|
+
const ret = wasm.txlayer1signature_new(sign_type, ptr0, len0);
|
|
3065
|
+
this.__wbg_ptr = ret >>> 0;
|
|
3066
|
+
return this;
|
|
3067
|
+
}
|
|
3068
|
+
/**
|
|
3069
|
+
* @returns {L1SignatureType}
|
|
3070
|
+
*/
|
|
3071
|
+
signType() {
|
|
3072
|
+
const ret = wasm.txlayer1signature_signType(this.__wbg_ptr);
|
|
3073
|
+
return ret;
|
|
3074
|
+
}
|
|
3075
|
+
/**
|
|
3076
|
+
* @returns {string}
|
|
3077
|
+
*/
|
|
3078
|
+
signature() {
|
|
3079
|
+
let deferred1_0;
|
|
3080
|
+
let deferred1_1;
|
|
3081
|
+
try {
|
|
3082
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3083
|
+
wasm.txlayer1signature_signature(retptr, this.__wbg_ptr);
|
|
3084
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3085
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3086
|
+
deferred1_0 = r0;
|
|
3087
|
+
deferred1_1 = r1;
|
|
3088
|
+
return getStringFromWasm0(r0, r1);
|
|
3089
|
+
}
|
|
3090
|
+
finally {
|
|
3091
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3092
|
+
wasm.__wbindgen_export_5(deferred1_0, deferred1_1, 1);
|
|
3093
|
+
}
|
|
3094
|
+
}
|
|
3095
|
+
}
|
|
3096
|
+
const TxZkLinkSignatureFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3097
|
+
? { register: () => { }, unregister: () => { } }
|
|
3098
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_txzklinksignature_free(ptr >>> 0));
|
|
3099
|
+
/**
|
|
3100
|
+
*/
|
|
3101
|
+
export class TxZkLinkSignature {
|
|
3102
|
+
static __wrap(ptr) {
|
|
3103
|
+
ptr = ptr >>> 0;
|
|
3104
|
+
const obj = Object.create(TxZkLinkSignature.prototype);
|
|
3105
|
+
obj.__wbg_ptr = ptr;
|
|
3106
|
+
TxZkLinkSignatureFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3107
|
+
return obj;
|
|
3108
|
+
}
|
|
3109
|
+
__destroy_into_raw() {
|
|
3110
|
+
const ptr = this.__wbg_ptr;
|
|
3111
|
+
this.__wbg_ptr = 0;
|
|
3112
|
+
TxZkLinkSignatureFinalization.unregister(this);
|
|
3113
|
+
return ptr;
|
|
3114
|
+
}
|
|
3115
|
+
free() {
|
|
3116
|
+
const ptr = this.__destroy_into_raw();
|
|
3117
|
+
wasm.__wbg_txzklinksignature_free(ptr);
|
|
3118
|
+
}
|
|
3119
|
+
/**
|
|
3120
|
+
* @param {string} pub_key
|
|
3121
|
+
* @param {string} signature
|
|
3122
|
+
*/
|
|
3123
|
+
constructor(pub_key, signature) {
|
|
3124
|
+
try {
|
|
3125
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3126
|
+
const ptr0 = passStringToWasm0(pub_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3127
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3128
|
+
const ptr1 = passStringToWasm0(signature, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3129
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3130
|
+
wasm.txzklinksignature_new(retptr, ptr0, len0, ptr1, len1);
|
|
3131
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3132
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3133
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3134
|
+
if (r2) {
|
|
3135
|
+
throw takeObject(r1);
|
|
3136
|
+
}
|
|
3137
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
3138
|
+
return this;
|
|
3139
|
+
}
|
|
3140
|
+
finally {
|
|
3141
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3142
|
+
}
|
|
3143
|
+
}
|
|
3144
|
+
/**
|
|
3145
|
+
* @returns {string}
|
|
3146
|
+
*/
|
|
3147
|
+
pubKey() {
|
|
3148
|
+
let deferred1_0;
|
|
3149
|
+
let deferred1_1;
|
|
3150
|
+
try {
|
|
3151
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3152
|
+
wasm.txzklinksignature_pubKey(retptr, this.__wbg_ptr);
|
|
3153
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3154
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3155
|
+
deferred1_0 = r0;
|
|
3156
|
+
deferred1_1 = r1;
|
|
3157
|
+
return getStringFromWasm0(r0, r1);
|
|
3158
|
+
}
|
|
3159
|
+
finally {
|
|
3160
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3161
|
+
wasm.__wbindgen_export_5(deferred1_0, deferred1_1, 1);
|
|
3162
|
+
}
|
|
3163
|
+
}
|
|
3164
|
+
/**
|
|
3165
|
+
* @returns {string}
|
|
3166
|
+
*/
|
|
3167
|
+
signature() {
|
|
3168
|
+
let deferred1_0;
|
|
3169
|
+
let deferred1_1;
|
|
3170
|
+
try {
|
|
3171
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3172
|
+
wasm.txzklinksignature_signature(retptr, this.__wbg_ptr);
|
|
3173
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3174
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3175
|
+
deferred1_0 = r0;
|
|
3176
|
+
deferred1_1 = r1;
|
|
3177
|
+
return getStringFromWasm0(r0, r1);
|
|
3178
|
+
}
|
|
3179
|
+
finally {
|
|
3180
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3181
|
+
wasm.__wbindgen_export_5(deferred1_0, deferred1_1, 1);
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
const UpdateGlobalVarFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3186
|
+
? { register: () => { }, unregister: () => { } }
|
|
3187
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_updateglobalvar_free(ptr >>> 0));
|
|
3188
|
+
/**
|
|
3189
|
+
*/
|
|
3190
|
+
export class UpdateGlobalVar {
|
|
3191
|
+
static __wrap(ptr) {
|
|
3192
|
+
ptr = ptr >>> 0;
|
|
3193
|
+
const obj = Object.create(UpdateGlobalVar.prototype);
|
|
3194
|
+
obj.__wbg_ptr = ptr;
|
|
3195
|
+
UpdateGlobalVarFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3196
|
+
return obj;
|
|
3197
|
+
}
|
|
3198
|
+
__destroy_into_raw() {
|
|
3199
|
+
const ptr = this.__wbg_ptr;
|
|
3200
|
+
this.__wbg_ptr = 0;
|
|
3201
|
+
UpdateGlobalVarFinalization.unregister(this);
|
|
3202
|
+
return ptr;
|
|
3203
|
+
}
|
|
3204
|
+
free() {
|
|
3205
|
+
const ptr = this.__destroy_into_raw();
|
|
3206
|
+
wasm.__wbg_updateglobalvar_free(ptr);
|
|
3207
|
+
}
|
|
3208
|
+
/**
|
|
3209
|
+
* @returns {any}
|
|
3210
|
+
*/
|
|
3211
|
+
jsValue() {
|
|
3212
|
+
try {
|
|
3213
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3214
|
+
wasm.updateglobalvar_jsValue(retptr, this.__wbg_ptr);
|
|
3215
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3216
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3217
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3218
|
+
if (r2) {
|
|
3219
|
+
throw takeObject(r1);
|
|
3220
|
+
}
|
|
3221
|
+
return takeObject(r0);
|
|
3222
|
+
}
|
|
3223
|
+
finally {
|
|
3224
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3225
|
+
}
|
|
3226
|
+
}
|
|
3227
|
+
/**
|
|
3228
|
+
* @returns {any}
|
|
3229
|
+
*/
|
|
3230
|
+
zklinkTx() {
|
|
3231
|
+
try {
|
|
3232
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3233
|
+
wasm.updateglobalvar_zklinkTx(retptr, this.__wbg_ptr);
|
|
3234
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3235
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3236
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3237
|
+
if (r2) {
|
|
3238
|
+
throw takeObject(r1);
|
|
3239
|
+
}
|
|
3240
|
+
return takeObject(r0);
|
|
3241
|
+
}
|
|
3242
|
+
finally {
|
|
3243
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
}
|
|
3247
|
+
const UpdateGlobalVarBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3248
|
+
? { register: () => { }, unregister: () => { } }
|
|
3249
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_updateglobalvarbuilder_free(ptr >>> 0));
|
|
3250
|
+
/**
|
|
3251
|
+
*/
|
|
3252
|
+
export class UpdateGlobalVarBuilder {
|
|
3253
|
+
__destroy_into_raw() {
|
|
3254
|
+
const ptr = this.__wbg_ptr;
|
|
3255
|
+
this.__wbg_ptr = 0;
|
|
3256
|
+
UpdateGlobalVarBuilderFinalization.unregister(this);
|
|
3257
|
+
return ptr;
|
|
3258
|
+
}
|
|
3259
|
+
free() {
|
|
3260
|
+
const ptr = this.__destroy_into_raw();
|
|
3261
|
+
wasm.__wbg_updateglobalvarbuilder_free(ptr);
|
|
3262
|
+
}
|
|
3263
|
+
/**
|
|
3264
|
+
* @param {number} from_chain_id
|
|
3265
|
+
* @param {number} sub_account_id
|
|
3266
|
+
* @param {Parameter} parameter
|
|
3267
|
+
* @param {number} serial_id
|
|
3268
|
+
*/
|
|
3269
|
+
constructor(from_chain_id, sub_account_id, parameter, serial_id) {
|
|
3270
|
+
try {
|
|
3271
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3272
|
+
_assertClass(parameter, Parameter);
|
|
3273
|
+
var ptr0 = parameter.__destroy_into_raw();
|
|
3274
|
+
wasm.updateglobalvarbuilder_new(retptr, from_chain_id, sub_account_id, ptr0, serial_id);
|
|
3275
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3276
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3277
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3278
|
+
if (r2) {
|
|
3279
|
+
throw takeObject(r1);
|
|
3280
|
+
}
|
|
3281
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
3282
|
+
return this;
|
|
3283
|
+
}
|
|
3284
|
+
finally {
|
|
3285
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
/**
|
|
3289
|
+
* @returns {UpdateGlobalVar}
|
|
3290
|
+
*/
|
|
3291
|
+
build() {
|
|
3292
|
+
const ptr = this.__destroy_into_raw();
|
|
3293
|
+
const ret = wasm.updateglobalvarbuilder_build(ptr);
|
|
3294
|
+
return UpdateGlobalVar.__wrap(ret);
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
const WalletFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3298
|
+
? { register: () => { }, unregister: () => { } }
|
|
3299
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wallet_free(ptr >>> 0));
|
|
3300
|
+
/**
|
|
3301
|
+
*/
|
|
3302
|
+
export class Wallet {
|
|
3303
|
+
__destroy_into_raw() {
|
|
3304
|
+
const ptr = this.__wbg_ptr;
|
|
3305
|
+
this.__wbg_ptr = 0;
|
|
3306
|
+
WalletFinalization.unregister(this);
|
|
3307
|
+
return ptr;
|
|
3308
|
+
}
|
|
3309
|
+
free() {
|
|
3310
|
+
const ptr = this.__destroy_into_raw();
|
|
3311
|
+
wasm.__wbg_wallet_free(ptr);
|
|
3312
|
+
}
|
|
3313
|
+
/**
|
|
3314
|
+
* @param {string} url
|
|
3315
|
+
* @param {string} private_key
|
|
3316
|
+
*/
|
|
3317
|
+
constructor(url, private_key) {
|
|
3318
|
+
try {
|
|
3319
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3320
|
+
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3321
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3322
|
+
const ptr1 = passStringToWasm0(private_key, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3323
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3324
|
+
wasm.wallet_new(retptr, ptr0, len0, ptr1, len1);
|
|
3325
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3326
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3327
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3328
|
+
if (r2) {
|
|
3329
|
+
throw takeObject(r1);
|
|
3330
|
+
}
|
|
3331
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
3332
|
+
return this;
|
|
3333
|
+
}
|
|
3334
|
+
finally {
|
|
3335
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3336
|
+
}
|
|
3337
|
+
}
|
|
3338
|
+
/**
|
|
3339
|
+
* @returns {Promise<string>}
|
|
3340
|
+
*/
|
|
3341
|
+
getBalance() {
|
|
3342
|
+
const ret = wasm.wallet_getBalance(this.__wbg_ptr);
|
|
3343
|
+
return takeObject(ret);
|
|
3344
|
+
}
|
|
3345
|
+
/**
|
|
3346
|
+
* @param {BlockNumber} block_number
|
|
3347
|
+
* @param {number | undefined} [block]
|
|
3348
|
+
* @returns {Promise<number>}
|
|
3349
|
+
*/
|
|
3350
|
+
getNonce(block_number, block) {
|
|
3351
|
+
const ret = wasm.wallet_getNonce(this.__wbg_ptr, block_number, !isLikeNone(block), isLikeNone(block) ? 0 : block);
|
|
3352
|
+
return takeObject(ret);
|
|
3353
|
+
}
|
|
3354
|
+
/**
|
|
3355
|
+
* @param {EthTxOption} eth_params
|
|
3356
|
+
* @returns {Promise<string>}
|
|
3357
|
+
*/
|
|
3358
|
+
getDepositFee(eth_params) {
|
|
3359
|
+
_assertClass(eth_params, EthTxOption);
|
|
3360
|
+
var ptr0 = eth_params.__destroy_into_raw();
|
|
3361
|
+
const ret = wasm.wallet_getDepositFee(this.__wbg_ptr, ptr0);
|
|
3362
|
+
return takeObject(ret);
|
|
3363
|
+
}
|
|
3364
|
+
/**
|
|
3365
|
+
* @param {string} tx_hash
|
|
3366
|
+
* @param {number | undefined} [timeout]
|
|
3367
|
+
* @returns {Promise<WaitForTxStatus>}
|
|
3368
|
+
*/
|
|
3369
|
+
waitForTransaction(tx_hash, timeout) {
|
|
3370
|
+
const ptr0 = passStringToWasm0(tx_hash, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3371
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3372
|
+
const ret = wasm.wallet_waitForTransaction(this.__wbg_ptr, ptr0, len0, !isLikeNone(timeout), isLikeNone(timeout) ? 0 : timeout);
|
|
3373
|
+
return takeObject(ret);
|
|
3374
|
+
}
|
|
3375
|
+
/**
|
|
3376
|
+
* @param {string} contract
|
|
3377
|
+
* @param {string} amount
|
|
3378
|
+
* @param {EthTxOption} eth_params
|
|
3379
|
+
* @returns {Promise<string>}
|
|
3380
|
+
*/
|
|
3381
|
+
approveERC20(contract, amount, eth_params) {
|
|
3382
|
+
const ptr0 = passStringToWasm0(contract, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3383
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3384
|
+
const ptr1 = passStringToWasm0(amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3385
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3386
|
+
_assertClass(eth_params, EthTxOption);
|
|
3387
|
+
var ptr2 = eth_params.__destroy_into_raw();
|
|
3388
|
+
const ret = wasm.wallet_approveERC20(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2);
|
|
3389
|
+
return takeObject(ret);
|
|
3390
|
+
}
|
|
3391
|
+
/**
|
|
3392
|
+
* @param {number} sub_account_id
|
|
3393
|
+
* @param {string} deposit_to
|
|
3394
|
+
* @param {string} token_addr
|
|
3395
|
+
* @param {string} amount
|
|
3396
|
+
* @param {boolean} mapping
|
|
3397
|
+
* @param {EthTxOption} eth_params
|
|
3398
|
+
* @param {boolean} is_gateway
|
|
3399
|
+
* @returns {Promise<string>}
|
|
3400
|
+
*/
|
|
3401
|
+
depositERC20(sub_account_id, deposit_to, token_addr, amount, mapping, eth_params, is_gateway) {
|
|
3402
|
+
const ptr0 = passStringToWasm0(deposit_to, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3403
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3404
|
+
const ptr1 = passStringToWasm0(token_addr, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3405
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3406
|
+
const ptr2 = passStringToWasm0(amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3407
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3408
|
+
_assertClass(eth_params, EthTxOption);
|
|
3409
|
+
var ptr3 = eth_params.__destroy_into_raw();
|
|
3410
|
+
const ret = wasm.wallet_depositERC20(this.__wbg_ptr, sub_account_id, ptr0, len0, ptr1, len1, ptr2, len2, mapping, ptr3, is_gateway);
|
|
3411
|
+
return takeObject(ret);
|
|
3412
|
+
}
|
|
3413
|
+
/**
|
|
3414
|
+
* @param {number} sub_account_id
|
|
3415
|
+
* @param {string} deposit_to
|
|
3416
|
+
* @param {EthTxOption} eth_params
|
|
3417
|
+
* @param {boolean} is_gateway
|
|
3418
|
+
* @returns {Promise<string>}
|
|
3419
|
+
*/
|
|
3420
|
+
depositETH(sub_account_id, deposit_to, eth_params, is_gateway) {
|
|
3421
|
+
const ptr0 = passStringToWasm0(deposit_to, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3422
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3423
|
+
_assertClass(eth_params, EthTxOption);
|
|
3424
|
+
var ptr1 = eth_params.__destroy_into_raw();
|
|
3425
|
+
const ret = wasm.wallet_depositETH(this.__wbg_ptr, sub_account_id, ptr0, len0, ptr1, is_gateway);
|
|
3426
|
+
return takeObject(ret);
|
|
3427
|
+
}
|
|
3428
|
+
/**
|
|
3429
|
+
* @param {number} nonce
|
|
3430
|
+
* @param {string} new_pubkey_hash
|
|
3431
|
+
* @param {EthTxOption} eth_params
|
|
3432
|
+
* @returns {Promise<string>}
|
|
3433
|
+
*/
|
|
3434
|
+
setAuthPubkeyHash(nonce, new_pubkey_hash, eth_params) {
|
|
3435
|
+
const ptr0 = passStringToWasm0(new_pubkey_hash, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3436
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3437
|
+
_assertClass(eth_params, EthTxOption);
|
|
3438
|
+
var ptr1 = eth_params.__destroy_into_raw();
|
|
3439
|
+
const ret = wasm.wallet_setAuthPubkeyHash(this.__wbg_ptr, nonce, ptr0, len0, ptr1);
|
|
3440
|
+
return takeObject(ret);
|
|
3441
|
+
}
|
|
3442
|
+
/**
|
|
3443
|
+
* @param {number} account_id
|
|
3444
|
+
* @param {number} sub_account_id
|
|
3445
|
+
* @param {number} token_id
|
|
3446
|
+
* @param {boolean} mapping
|
|
3447
|
+
* @param {EthTxOption} eth_params
|
|
3448
|
+
* @returns {Promise<string>}
|
|
3449
|
+
*/
|
|
3450
|
+
fullExit(account_id, sub_account_id, token_id, mapping, eth_params) {
|
|
3451
|
+
_assertClass(eth_params, EthTxOption);
|
|
3452
|
+
var ptr0 = eth_params.__destroy_into_raw();
|
|
3453
|
+
const ret = wasm.wallet_fullExit(this.__wbg_ptr, account_id, sub_account_id, token_id, mapping, ptr0);
|
|
3454
|
+
return takeObject(ret);
|
|
3455
|
+
}
|
|
3456
|
+
}
|
|
3457
|
+
const WithdrawFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3458
|
+
? { register: () => { }, unregister: () => { } }
|
|
3459
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_withdraw_free(ptr >>> 0));
|
|
3460
|
+
/**
|
|
3461
|
+
*/
|
|
3462
|
+
export class Withdraw {
|
|
3463
|
+
static __wrap(ptr) {
|
|
3464
|
+
ptr = ptr >>> 0;
|
|
3465
|
+
const obj = Object.create(Withdraw.prototype);
|
|
3466
|
+
obj.__wbg_ptr = ptr;
|
|
3467
|
+
WithdrawFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3468
|
+
return obj;
|
|
3469
|
+
}
|
|
3470
|
+
__destroy_into_raw() {
|
|
3471
|
+
const ptr = this.__wbg_ptr;
|
|
3472
|
+
this.__wbg_ptr = 0;
|
|
3473
|
+
WithdrawFinalization.unregister(this);
|
|
3474
|
+
return ptr;
|
|
3475
|
+
}
|
|
3476
|
+
free() {
|
|
3477
|
+
const ptr = this.__destroy_into_raw();
|
|
3478
|
+
wasm.__wbg_withdraw_free(ptr);
|
|
3479
|
+
}
|
|
3480
|
+
/**
|
|
3481
|
+
* @returns {any}
|
|
3482
|
+
*/
|
|
3483
|
+
jsValue() {
|
|
3484
|
+
try {
|
|
3485
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3486
|
+
wasm.withdraw_jsValue(retptr, this.__wbg_ptr);
|
|
3487
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3488
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3489
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3490
|
+
if (r2) {
|
|
3491
|
+
throw takeObject(r1);
|
|
3492
|
+
}
|
|
3493
|
+
return takeObject(r0);
|
|
3494
|
+
}
|
|
3495
|
+
finally {
|
|
3496
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3497
|
+
}
|
|
3498
|
+
}
|
|
3499
|
+
/**
|
|
3500
|
+
* @param {string} token_symbol
|
|
3501
|
+
* @returns {string}
|
|
3502
|
+
*/
|
|
3503
|
+
getEthSignMsg(token_symbol) {
|
|
3504
|
+
let deferred2_0;
|
|
3505
|
+
let deferred2_1;
|
|
3506
|
+
try {
|
|
3507
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3508
|
+
const ptr0 = passStringToWasm0(token_symbol, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3509
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3510
|
+
wasm.withdraw_getEthSignMsg(retptr, this.__wbg_ptr, ptr0, len0);
|
|
3511
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3512
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3513
|
+
deferred2_0 = r0;
|
|
3514
|
+
deferred2_1 = r1;
|
|
3515
|
+
return getStringFromWasm0(r0, r1);
|
|
3516
|
+
}
|
|
3517
|
+
finally {
|
|
3518
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3519
|
+
wasm.__wbindgen_export_5(deferred2_0, deferred2_1, 1);
|
|
3520
|
+
}
|
|
3521
|
+
}
|
|
3522
|
+
/**
|
|
3523
|
+
* @param {ZkLinkSigner} signer
|
|
3524
|
+
* @returns {any}
|
|
3525
|
+
*/
|
|
3526
|
+
sign(signer) {
|
|
3527
|
+
try {
|
|
3528
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3529
|
+
_assertClass(signer, ZkLinkSigner);
|
|
3530
|
+
var ptr0 = signer.__destroy_into_raw();
|
|
3531
|
+
wasm.withdraw_sign(retptr, this.__wbg_ptr, ptr0);
|
|
3532
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3533
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3534
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3535
|
+
if (r2) {
|
|
3536
|
+
throw takeObject(r1);
|
|
3537
|
+
}
|
|
3538
|
+
return takeObject(r0);
|
|
3539
|
+
}
|
|
3540
|
+
finally {
|
|
3541
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
const WithdrawBuilderFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3546
|
+
? { register: () => { }, unregister: () => { } }
|
|
3547
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_withdrawbuilder_free(ptr >>> 0));
|
|
3548
|
+
/**
|
|
3549
|
+
*/
|
|
3550
|
+
export class WithdrawBuilder {
|
|
3551
|
+
__destroy_into_raw() {
|
|
3552
|
+
const ptr = this.__wbg_ptr;
|
|
3553
|
+
this.__wbg_ptr = 0;
|
|
3554
|
+
WithdrawBuilderFinalization.unregister(this);
|
|
3555
|
+
return ptr;
|
|
3556
|
+
}
|
|
3557
|
+
free() {
|
|
3558
|
+
const ptr = this.__destroy_into_raw();
|
|
3559
|
+
wasm.__wbg_withdrawbuilder_free(ptr);
|
|
3560
|
+
}
|
|
3561
|
+
/**
|
|
3562
|
+
* @param {number} account_id
|
|
3563
|
+
* @param {number} sub_account_id
|
|
3564
|
+
* @param {number} to_chain_id
|
|
3565
|
+
* @param {string} to_address
|
|
3566
|
+
* @param {number} l2_source_token
|
|
3567
|
+
* @param {number} l1_target_token
|
|
3568
|
+
* @param {string} amount
|
|
3569
|
+
* @param {string | undefined} call_data
|
|
3570
|
+
* @param {string} fee
|
|
3571
|
+
* @param {number} nonce
|
|
3572
|
+
* @param {boolean} withdraw_to_l1
|
|
3573
|
+
* @param {number} withdraw_fee_ratio
|
|
3574
|
+
* @param {number | undefined} [ts]
|
|
3575
|
+
*/
|
|
3576
|
+
constructor(account_id, sub_account_id, to_chain_id, to_address, l2_source_token, l1_target_token, amount, call_data, fee, nonce, withdraw_to_l1, withdraw_fee_ratio, ts) {
|
|
3577
|
+
try {
|
|
3578
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3579
|
+
const ptr0 = passStringToWasm0(to_address, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3580
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3581
|
+
const ptr1 = passStringToWasm0(amount, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3582
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3583
|
+
var ptr2 = isLikeNone(call_data)
|
|
3584
|
+
? 0
|
|
3585
|
+
: passStringToWasm0(call_data, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3586
|
+
var len2 = WASM_VECTOR_LEN;
|
|
3587
|
+
const ptr3 = passStringToWasm0(fee, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3588
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3589
|
+
wasm.withdrawbuilder_new(retptr, account_id, sub_account_id, to_chain_id, ptr0, len0, l2_source_token, l1_target_token, ptr1, len1, ptr2, len2, ptr3, len3, nonce, withdraw_to_l1, withdraw_fee_ratio, !isLikeNone(ts), isLikeNone(ts) ? 0 : ts);
|
|
3590
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3591
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3592
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3593
|
+
if (r2) {
|
|
3594
|
+
throw takeObject(r1);
|
|
3595
|
+
}
|
|
3596
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
3597
|
+
return this;
|
|
3598
|
+
}
|
|
3599
|
+
finally {
|
|
3600
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3603
|
+
/**
|
|
3604
|
+
* @returns {Withdraw}
|
|
3605
|
+
*/
|
|
3606
|
+
build() {
|
|
3607
|
+
const ptr = this.__destroy_into_raw();
|
|
3608
|
+
const ret = wasm.withdrawbuilder_build(ptr);
|
|
3609
|
+
return Withdraw.__wrap(ret);
|
|
3610
|
+
}
|
|
3611
|
+
}
|
|
3612
|
+
const ZkLinkSignerFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3613
|
+
? { register: () => { }, unregister: () => { } }
|
|
3614
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zklinksigner_free(ptr >>> 0));
|
|
3615
|
+
/**
|
|
3616
|
+
*/
|
|
3617
|
+
export class ZkLinkSigner {
|
|
3618
|
+
static __wrap(ptr) {
|
|
3619
|
+
ptr = ptr >>> 0;
|
|
3620
|
+
const obj = Object.create(ZkLinkSigner.prototype);
|
|
3621
|
+
obj.__wbg_ptr = ptr;
|
|
3622
|
+
ZkLinkSignerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3623
|
+
return obj;
|
|
3624
|
+
}
|
|
3625
|
+
__destroy_into_raw() {
|
|
3626
|
+
const ptr = this.__wbg_ptr;
|
|
3627
|
+
this.__wbg_ptr = 0;
|
|
3628
|
+
ZkLinkSignerFinalization.unregister(this);
|
|
3629
|
+
return ptr;
|
|
3630
|
+
}
|
|
3631
|
+
free() {
|
|
3632
|
+
const ptr = this.__destroy_into_raw();
|
|
3633
|
+
wasm.__wbg_zklinksigner_free(ptr);
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* @param {string} sig
|
|
3637
|
+
* @returns {ZkLinkSigner}
|
|
3638
|
+
*/
|
|
3639
|
+
static ethSig(sig) {
|
|
3640
|
+
try {
|
|
3641
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3642
|
+
const ptr0 = passStringToWasm0(sig, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3643
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3644
|
+
wasm.zklinksigner_ethSig(retptr, ptr0, len0);
|
|
3645
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3646
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3647
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3648
|
+
if (r2) {
|
|
3649
|
+
throw takeObject(r1);
|
|
3650
|
+
}
|
|
3651
|
+
return ZkLinkSigner.__wrap(r0);
|
|
3652
|
+
}
|
|
3653
|
+
finally {
|
|
3654
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
/**
|
|
3658
|
+
* @param {string} sig
|
|
3659
|
+
* @returns {ZkLinkSigner}
|
|
3660
|
+
*/
|
|
3661
|
+
static starknetSig(sig) {
|
|
3662
|
+
try {
|
|
3663
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3664
|
+
const ptr0 = passStringToWasm0(sig, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3665
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3666
|
+
wasm.zklinksigner_starknetSig(retptr, ptr0, len0);
|
|
3667
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
3668
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
3669
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
3670
|
+
if (r2) {
|
|
3671
|
+
throw takeObject(r1);
|
|
3672
|
+
}
|
|
3673
|
+
return ZkLinkSigner.__wrap(r0);
|
|
3674
|
+
}
|
|
3675
|
+
finally {
|
|
3676
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3677
|
+
}
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
const ZkLinkTxFinalization = typeof FinalizationRegistry === 'undefined'
|
|
3681
|
+
? { register: () => { }, unregister: () => { } }
|
|
3682
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zklinktx_free(ptr >>> 0));
|
|
3683
|
+
/**
|
|
3684
|
+
*/
|
|
3685
|
+
export class ZkLinkTx {
|
|
3686
|
+
__destroy_into_raw() {
|
|
3687
|
+
const ptr = this.__wbg_ptr;
|
|
3688
|
+
this.__wbg_ptr = 0;
|
|
3689
|
+
ZkLinkTxFinalization.unregister(this);
|
|
3690
|
+
return ptr;
|
|
3691
|
+
}
|
|
3692
|
+
free() {
|
|
3693
|
+
const ptr = this.__destroy_into_raw();
|
|
3694
|
+
wasm.__wbg_zklinktx_free(ptr);
|
|
3695
|
+
}
|
|
3696
|
+
/**
|
|
3697
|
+
* @param {number} tx_type
|
|
3698
|
+
* @param {any} tx
|
|
3699
|
+
*/
|
|
3700
|
+
constructor(tx_type, tx) {
|
|
3701
|
+
const ret = wasm.zklinktx_new(tx_type, addHeapObject(tx));
|
|
3702
|
+
this.__wbg_ptr = ret >>> 0;
|
|
3703
|
+
return this;
|
|
3704
|
+
}
|
|
3705
|
+
}
|
|
3706
|
+
async function __wbg_load(module, imports) {
|
|
3707
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
3708
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
3709
|
+
try {
|
|
3710
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
3711
|
+
}
|
|
3712
|
+
catch (e) {
|
|
3713
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
3714
|
+
console.warn('`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n', e);
|
|
3715
|
+
}
|
|
3716
|
+
else {
|
|
3717
|
+
throw e;
|
|
3718
|
+
}
|
|
3719
|
+
}
|
|
3720
|
+
}
|
|
3721
|
+
const bytes = await module.arrayBuffer();
|
|
3722
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
3723
|
+
}
|
|
3724
|
+
else {
|
|
3725
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
3726
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
3727
|
+
return { instance, module };
|
|
3728
|
+
}
|
|
3729
|
+
else {
|
|
3730
|
+
return instance;
|
|
3731
|
+
}
|
|
3732
|
+
}
|
|
3733
|
+
}
|
|
3734
|
+
function __wbg_get_imports() {
|
|
3735
|
+
const imports = {};
|
|
3736
|
+
imports.wbg = {};
|
|
3737
|
+
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
|
|
3738
|
+
takeObject(arg0);
|
|
3739
|
+
};
|
|
3740
|
+
imports.wbg.__wbg_request_aa80f2dd90291bcc = function () {
|
|
3741
|
+
return handleError(function (arg0, arg1) {
|
|
3742
|
+
const ret = getObject(arg0).request(takeObject(arg1));
|
|
3743
|
+
return addHeapObject(ret);
|
|
3744
|
+
}, arguments);
|
|
3745
|
+
};
|
|
3746
|
+
imports.wbg.__wbg_signMessage_31620e519ceecf94 = function () {
|
|
3747
|
+
return handleError(function (arg0, arg1) {
|
|
3748
|
+
const ret = getObject(arg0).signMessage(getObject(arg1));
|
|
3749
|
+
return addHeapObject(ret);
|
|
3750
|
+
}, arguments);
|
|
3751
|
+
};
|
|
3752
|
+
imports.wbg.__wbindgen_number_new = function (arg0) {
|
|
3753
|
+
const ret = arg0;
|
|
3754
|
+
return addHeapObject(ret);
|
|
3755
|
+
};
|
|
3756
|
+
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
|
|
3757
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
3758
|
+
return addHeapObject(ret);
|
|
3759
|
+
};
|
|
3760
|
+
imports.wbg.__wbindgen_is_undefined = function (arg0) {
|
|
3761
|
+
const ret = getObject(arg0) === undefined;
|
|
3762
|
+
return ret;
|
|
3763
|
+
};
|
|
3764
|
+
imports.wbg.__wbindgen_in = function (arg0, arg1) {
|
|
3765
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
3766
|
+
return ret;
|
|
3767
|
+
};
|
|
3768
|
+
imports.wbg.__wbindgen_boolean_get = function (arg0) {
|
|
3769
|
+
const v = getObject(arg0);
|
|
3770
|
+
const ret = typeof v === 'boolean' ? (v ? 1 : 0) : 2;
|
|
3771
|
+
return ret;
|
|
3772
|
+
};
|
|
3773
|
+
imports.wbg.__wbindgen_is_bigint = function (arg0) {
|
|
3774
|
+
const ret = typeof getObject(arg0) === 'bigint';
|
|
3775
|
+
return ret;
|
|
3776
|
+
};
|
|
3777
|
+
imports.wbg.__wbindgen_number_get = function (arg0, arg1) {
|
|
3778
|
+
const obj = getObject(arg1);
|
|
3779
|
+
const ret = typeof obj === 'number' ? obj : undefined;
|
|
3780
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
3781
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
3782
|
+
};
|
|
3783
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function (arg0) {
|
|
3784
|
+
const ret = arg0;
|
|
3785
|
+
return addHeapObject(ret);
|
|
3786
|
+
};
|
|
3787
|
+
imports.wbg.__wbindgen_jsval_eq = function (arg0, arg1) {
|
|
3788
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
3789
|
+
return ret;
|
|
3790
|
+
};
|
|
3791
|
+
imports.wbg.__wbindgen_string_get = function (arg0, arg1) {
|
|
3792
|
+
const obj = getObject(arg1);
|
|
3793
|
+
const ret = typeof obj === 'string' ? obj : undefined;
|
|
3794
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3795
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3796
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
3797
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
3798
|
+
};
|
|
3799
|
+
imports.wbg.__wbindgen_is_object = function (arg0) {
|
|
3800
|
+
const val = getObject(arg0);
|
|
3801
|
+
const ret = typeof val === 'object' && val !== null;
|
|
3802
|
+
return ret;
|
|
3803
|
+
};
|
|
3804
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
|
|
3805
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
3806
|
+
return addHeapObject(ret);
|
|
3807
|
+
};
|
|
3808
|
+
imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
|
|
3809
|
+
const ret = getObject(arg0);
|
|
3810
|
+
return addHeapObject(ret);
|
|
3811
|
+
};
|
|
3812
|
+
imports.wbg.__wbindgen_as_number = function (arg0) {
|
|
3813
|
+
const ret = +getObject(arg0);
|
|
3814
|
+
return ret;
|
|
3815
|
+
};
|
|
3816
|
+
imports.wbg.__wbindgen_error_new = function (arg0, arg1) {
|
|
3817
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
3818
|
+
return addHeapObject(ret);
|
|
3819
|
+
};
|
|
3820
|
+
imports.wbg.__wbg_performance_eeefc685c9bc38b4 = function (arg0) {
|
|
3821
|
+
const ret = getObject(arg0).performance;
|
|
3822
|
+
return addHeapObject(ret);
|
|
3823
|
+
};
|
|
3824
|
+
imports.wbg.__wbg_now_e0d8ec93dd25766a = function (arg0) {
|
|
3825
|
+
const ret = getObject(arg0).now();
|
|
3826
|
+
return ret;
|
|
3827
|
+
};
|
|
3828
|
+
imports.wbg.__wbg_selectedAddress_e88960714bb47d11 = function (arg0, arg1) {
|
|
3829
|
+
const ret = getObject(arg1).selectedAddress;
|
|
3830
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3831
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3832
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
3833
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
3834
|
+
};
|
|
3835
|
+
imports.wbg.__wbg_address_b7ff4a10022d02d8 = function (arg0, arg1) {
|
|
3836
|
+
const ret = getObject(arg1).address;
|
|
3837
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3838
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3839
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
3840
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
3841
|
+
};
|
|
3842
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
|
|
3843
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
3844
|
+
return ret;
|
|
3845
|
+
};
|
|
3846
|
+
imports.wbg.__wbg_String_389b54bd9d25375f = function (arg0, arg1) {
|
|
3847
|
+
const ret = String(getObject(arg1));
|
|
3848
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3849
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3850
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
3851
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
3852
|
+
};
|
|
3853
|
+
imports.wbg.__wbg_getwithrefkey_4a92a5eca60879b9 = function (arg0, arg1) {
|
|
3854
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
3855
|
+
return addHeapObject(ret);
|
|
3856
|
+
};
|
|
3857
|
+
imports.wbg.__wbg_set_9182712abebf82ef = function (arg0, arg1, arg2) {
|
|
3858
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
3859
|
+
};
|
|
3860
|
+
imports.wbg.__wbindgen_cb_drop = function (arg0) {
|
|
3861
|
+
const obj = takeObject(arg0).original;
|
|
3862
|
+
if (obj.cnt-- == 1) {
|
|
3863
|
+
obj.a = 0;
|
|
3864
|
+
return true;
|
|
3865
|
+
}
|
|
3866
|
+
const ret = false;
|
|
3867
|
+
return ret;
|
|
3868
|
+
};
|
|
3869
|
+
imports.wbg.__wbg_clearTimeout_76877dbc010e786d = function (arg0) {
|
|
3870
|
+
const ret = clearTimeout(takeObject(arg0));
|
|
3871
|
+
return addHeapObject(ret);
|
|
3872
|
+
};
|
|
3873
|
+
imports.wbg.__wbg_setTimeout_75cb9b6991a4031d = function () {
|
|
3874
|
+
return handleError(function (arg0, arg1) {
|
|
3875
|
+
const ret = setTimeout(getObject(arg0), arg1);
|
|
3876
|
+
return addHeapObject(ret);
|
|
3877
|
+
}, arguments);
|
|
3878
|
+
};
|
|
3879
|
+
imports.wbg.__wbg_fetch_6a2624d7f767e331 = function (arg0) {
|
|
3880
|
+
const ret = fetch(getObject(arg0));
|
|
3881
|
+
return addHeapObject(ret);
|
|
3882
|
+
};
|
|
3883
|
+
imports.wbg.__wbg_fetch_693453ca3f88c055 = function (arg0, arg1) {
|
|
3884
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
3885
|
+
return addHeapObject(ret);
|
|
3886
|
+
};
|
|
3887
|
+
imports.wbg.__wbg_new_7a20246daa6eec7e = function () {
|
|
3888
|
+
return handleError(function () {
|
|
3889
|
+
const ret = new Headers();
|
|
3890
|
+
return addHeapObject(ret);
|
|
3891
|
+
}, arguments);
|
|
3892
|
+
};
|
|
3893
|
+
imports.wbg.__wbg_append_aa3f462f9e2b5ff2 = function () {
|
|
3894
|
+
return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
3895
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
3896
|
+
}, arguments);
|
|
3897
|
+
};
|
|
3898
|
+
imports.wbg.__wbg_newwithstrandinit_f581dff0d19a8b03 = function () {
|
|
3899
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
3900
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
3901
|
+
return addHeapObject(ret);
|
|
3902
|
+
}, arguments);
|
|
3903
|
+
};
|
|
3904
|
+
imports.wbg.__wbg_signal_3c701f5f40a5f08d = function (arg0) {
|
|
3905
|
+
const ret = getObject(arg0).signal;
|
|
3906
|
+
return addHeapObject(ret);
|
|
3907
|
+
};
|
|
3908
|
+
imports.wbg.__wbg_new_0ae46f44b7485bb2 = function () {
|
|
3909
|
+
return handleError(function () {
|
|
3910
|
+
const ret = new AbortController();
|
|
3911
|
+
return addHeapObject(ret);
|
|
3912
|
+
}, arguments);
|
|
3913
|
+
};
|
|
3914
|
+
imports.wbg.__wbg_abort_2c4fb490d878d2b2 = function (arg0) {
|
|
3915
|
+
getObject(arg0).abort();
|
|
3916
|
+
};
|
|
3917
|
+
imports.wbg.__wbg_instanceof_Response_4c3b1446206114d1 = function (arg0) {
|
|
3918
|
+
let result;
|
|
3919
|
+
try {
|
|
3920
|
+
result = getObject(arg0) instanceof Response;
|
|
3921
|
+
}
|
|
3922
|
+
catch (_) {
|
|
3923
|
+
result = false;
|
|
3924
|
+
}
|
|
3925
|
+
const ret = result;
|
|
3926
|
+
return ret;
|
|
3927
|
+
};
|
|
3928
|
+
imports.wbg.__wbg_url_83a6a4f65f7a2b38 = function (arg0, arg1) {
|
|
3929
|
+
const ret = getObject(arg1).url;
|
|
3930
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
3931
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3932
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
3933
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
3934
|
+
};
|
|
3935
|
+
imports.wbg.__wbg_status_d6d47ad2837621eb = function (arg0) {
|
|
3936
|
+
const ret = getObject(arg0).status;
|
|
3937
|
+
return ret;
|
|
3938
|
+
};
|
|
3939
|
+
imports.wbg.__wbg_headers_24def508a7518df9 = function (arg0) {
|
|
3940
|
+
const ret = getObject(arg0).headers;
|
|
3941
|
+
return addHeapObject(ret);
|
|
3942
|
+
};
|
|
3943
|
+
imports.wbg.__wbg_arrayBuffer_5b2688e3dd873fed = function () {
|
|
3944
|
+
return handleError(function (arg0) {
|
|
3945
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
3946
|
+
return addHeapObject(ret);
|
|
3947
|
+
}, arguments);
|
|
3948
|
+
};
|
|
3949
|
+
imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function (arg0) {
|
|
3950
|
+
queueMicrotask(getObject(arg0));
|
|
3951
|
+
};
|
|
3952
|
+
imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function (arg0) {
|
|
3953
|
+
const ret = getObject(arg0).queueMicrotask;
|
|
3954
|
+
return addHeapObject(ret);
|
|
3955
|
+
};
|
|
3956
|
+
imports.wbg.__wbindgen_is_function = function (arg0) {
|
|
3957
|
+
const ret = typeof getObject(arg0) === 'function';
|
|
3958
|
+
return ret;
|
|
3959
|
+
};
|
|
3960
|
+
imports.wbg.__wbg_crypto_58f13aa23ffcb166 = function (arg0) {
|
|
3961
|
+
const ret = getObject(arg0).crypto;
|
|
3962
|
+
return addHeapObject(ret);
|
|
3963
|
+
};
|
|
3964
|
+
imports.wbg.__wbg_process_5b786e71d465a513 = function (arg0) {
|
|
3965
|
+
const ret = getObject(arg0).process;
|
|
3966
|
+
return addHeapObject(ret);
|
|
3967
|
+
};
|
|
3968
|
+
imports.wbg.__wbg_versions_c2ab80650590b6a2 = function (arg0) {
|
|
3969
|
+
const ret = getObject(arg0).versions;
|
|
3970
|
+
return addHeapObject(ret);
|
|
3971
|
+
};
|
|
3972
|
+
imports.wbg.__wbg_node_523d7bd03ef69fba = function (arg0) {
|
|
3973
|
+
const ret = getObject(arg0).node;
|
|
3974
|
+
return addHeapObject(ret);
|
|
3975
|
+
};
|
|
3976
|
+
imports.wbg.__wbindgen_is_string = function (arg0) {
|
|
3977
|
+
const ret = typeof getObject(arg0) === 'string';
|
|
3978
|
+
return ret;
|
|
3979
|
+
};
|
|
3980
|
+
imports.wbg.__wbg_require_2784e593a4674877 = function () {
|
|
3981
|
+
return handleError(function () {
|
|
3982
|
+
const ret = module.require;
|
|
3983
|
+
return addHeapObject(ret);
|
|
3984
|
+
}, arguments);
|
|
3985
|
+
};
|
|
3986
|
+
imports.wbg.__wbg_msCrypto_abcb1295e768d1f2 = function (arg0) {
|
|
3987
|
+
const ret = getObject(arg0).msCrypto;
|
|
3988
|
+
return addHeapObject(ret);
|
|
3989
|
+
};
|
|
3990
|
+
imports.wbg.__wbg_randomFillSync_a0d98aa11c81fe89 = function () {
|
|
3991
|
+
return handleError(function (arg0, arg1) {
|
|
3992
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
3993
|
+
}, arguments);
|
|
3994
|
+
};
|
|
3995
|
+
imports.wbg.__wbg_getRandomValues_504510b5564925af = function () {
|
|
3996
|
+
return handleError(function (arg0, arg1) {
|
|
3997
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
3998
|
+
}, arguments);
|
|
3999
|
+
};
|
|
4000
|
+
imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function (arg0, arg1) {
|
|
4001
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
4002
|
+
return addHeapObject(ret);
|
|
4003
|
+
};
|
|
4004
|
+
imports.wbg.__wbg_length_cd7af8117672b8b8 = function (arg0) {
|
|
4005
|
+
const ret = getObject(arg0).length;
|
|
4006
|
+
return ret;
|
|
4007
|
+
};
|
|
4008
|
+
imports.wbg.__wbg_new_16b304a2cfa7ff4a = function () {
|
|
4009
|
+
const ret = new Array();
|
|
4010
|
+
return addHeapObject(ret);
|
|
4011
|
+
};
|
|
4012
|
+
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function (arg0, arg1) {
|
|
4013
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
4014
|
+
return addHeapObject(ret);
|
|
4015
|
+
};
|
|
4016
|
+
imports.wbg.__wbg_new_d9bc3a0147634640 = function () {
|
|
4017
|
+
const ret = new Map();
|
|
4018
|
+
return addHeapObject(ret);
|
|
4019
|
+
};
|
|
4020
|
+
imports.wbg.__wbg_next_40fc327bfc8770e6 = function (arg0) {
|
|
4021
|
+
const ret = getObject(arg0).next;
|
|
4022
|
+
return addHeapObject(ret);
|
|
4023
|
+
};
|
|
4024
|
+
imports.wbg.__wbg_next_196c84450b364254 = function () {
|
|
4025
|
+
return handleError(function (arg0) {
|
|
4026
|
+
const ret = getObject(arg0).next();
|
|
4027
|
+
return addHeapObject(ret);
|
|
4028
|
+
}, arguments);
|
|
4029
|
+
};
|
|
4030
|
+
imports.wbg.__wbg_done_298b57d23c0fc80c = function (arg0) {
|
|
4031
|
+
const ret = getObject(arg0).done;
|
|
4032
|
+
return ret;
|
|
4033
|
+
};
|
|
4034
|
+
imports.wbg.__wbg_value_d93c65011f51a456 = function (arg0) {
|
|
4035
|
+
const ret = getObject(arg0).value;
|
|
4036
|
+
return addHeapObject(ret);
|
|
4037
|
+
};
|
|
4038
|
+
imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function () {
|
|
4039
|
+
const ret = Symbol.iterator;
|
|
4040
|
+
return addHeapObject(ret);
|
|
4041
|
+
};
|
|
4042
|
+
imports.wbg.__wbg_get_e3c254076557e348 = function () {
|
|
4043
|
+
return handleError(function (arg0, arg1) {
|
|
4044
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
4045
|
+
return addHeapObject(ret);
|
|
4046
|
+
}, arguments);
|
|
4047
|
+
};
|
|
4048
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function () {
|
|
4049
|
+
return handleError(function (arg0, arg1) {
|
|
4050
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
4051
|
+
return addHeapObject(ret);
|
|
4052
|
+
}, arguments);
|
|
4053
|
+
};
|
|
4054
|
+
imports.wbg.__wbg_new_72fb9a18b5ae2624 = function () {
|
|
4055
|
+
const ret = new Object();
|
|
4056
|
+
return addHeapObject(ret);
|
|
4057
|
+
};
|
|
4058
|
+
imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function () {
|
|
4059
|
+
return handleError(function () {
|
|
4060
|
+
const ret = self.self;
|
|
4061
|
+
return addHeapObject(ret);
|
|
4062
|
+
}, arguments);
|
|
4063
|
+
};
|
|
4064
|
+
imports.wbg.__wbg_window_c6fb939a7f436783 = function () {
|
|
4065
|
+
return handleError(function () {
|
|
4066
|
+
const ret = window.window;
|
|
4067
|
+
return addHeapObject(ret);
|
|
4068
|
+
}, arguments);
|
|
4069
|
+
};
|
|
4070
|
+
imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function () {
|
|
4071
|
+
return handleError(function () {
|
|
4072
|
+
const ret = globalThis.globalThis;
|
|
4073
|
+
return addHeapObject(ret);
|
|
4074
|
+
}, arguments);
|
|
4075
|
+
};
|
|
4076
|
+
imports.wbg.__wbg_global_207b558942527489 = function () {
|
|
4077
|
+
return handleError(function () {
|
|
4078
|
+
const ret = global.global;
|
|
4079
|
+
return addHeapObject(ret);
|
|
4080
|
+
}, arguments);
|
|
4081
|
+
};
|
|
4082
|
+
imports.wbg.__wbg_set_d4638f722068f043 = function (arg0, arg1, arg2) {
|
|
4083
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
4084
|
+
};
|
|
4085
|
+
imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function (arg0) {
|
|
4086
|
+
const ret = Array.isArray(getObject(arg0));
|
|
4087
|
+
return ret;
|
|
4088
|
+
};
|
|
4089
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function (arg0) {
|
|
4090
|
+
let result;
|
|
4091
|
+
try {
|
|
4092
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
4093
|
+
}
|
|
4094
|
+
catch (_) {
|
|
4095
|
+
result = false;
|
|
4096
|
+
}
|
|
4097
|
+
const ret = result;
|
|
4098
|
+
return ret;
|
|
4099
|
+
};
|
|
4100
|
+
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function () {
|
|
4101
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4102
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
4103
|
+
return addHeapObject(ret);
|
|
4104
|
+
}, arguments);
|
|
4105
|
+
};
|
|
4106
|
+
imports.wbg.__wbg_set_8417257aaedc936b = function (arg0, arg1, arg2) {
|
|
4107
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
4108
|
+
return addHeapObject(ret);
|
|
4109
|
+
};
|
|
4110
|
+
imports.wbg.__wbg_isSafeInteger_f7b04ef02296c4d2 = function (arg0) {
|
|
4111
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
4112
|
+
return ret;
|
|
4113
|
+
};
|
|
4114
|
+
imports.wbg.__wbg_entries_95cc2c823b285a09 = function (arg0) {
|
|
4115
|
+
const ret = Object.entries(getObject(arg0));
|
|
4116
|
+
return addHeapObject(ret);
|
|
4117
|
+
};
|
|
4118
|
+
imports.wbg.__wbg_new_81740750da40724f = function (arg0, arg1) {
|
|
4119
|
+
try {
|
|
4120
|
+
var state0 = { a: arg0, b: arg1 };
|
|
4121
|
+
var cb0 = (arg0, arg1) => {
|
|
4122
|
+
const a = state0.a;
|
|
4123
|
+
state0.a = 0;
|
|
4124
|
+
try {
|
|
4125
|
+
return __wbg_adapter_302(a, state0.b, arg0, arg1);
|
|
4126
|
+
}
|
|
4127
|
+
finally {
|
|
4128
|
+
state0.a = a;
|
|
4129
|
+
}
|
|
4130
|
+
};
|
|
4131
|
+
const ret = new Promise(cb0);
|
|
4132
|
+
return addHeapObject(ret);
|
|
4133
|
+
}
|
|
4134
|
+
finally {
|
|
4135
|
+
state0.a = state0.b = 0;
|
|
4136
|
+
}
|
|
4137
|
+
};
|
|
4138
|
+
imports.wbg.__wbg_resolve_b0083a7967828ec8 = function (arg0) {
|
|
4139
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
4140
|
+
return addHeapObject(ret);
|
|
4141
|
+
};
|
|
4142
|
+
imports.wbg.__wbg_then_0c86a60e8fcfe9f6 = function (arg0, arg1) {
|
|
4143
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
4144
|
+
return addHeapObject(ret);
|
|
4145
|
+
};
|
|
4146
|
+
imports.wbg.__wbg_then_a73caa9a87991566 = function (arg0, arg1, arg2) {
|
|
4147
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
4148
|
+
return addHeapObject(ret);
|
|
4149
|
+
};
|
|
4150
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function (arg0) {
|
|
4151
|
+
const ret = getObject(arg0).buffer;
|
|
4152
|
+
return addHeapObject(ret);
|
|
4153
|
+
};
|
|
4154
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function (arg0, arg1, arg2) {
|
|
4155
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
4156
|
+
return addHeapObject(ret);
|
|
4157
|
+
};
|
|
4158
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function (arg0) {
|
|
4159
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
4160
|
+
return addHeapObject(ret);
|
|
4161
|
+
};
|
|
4162
|
+
imports.wbg.__wbg_set_a47bac70306a19a7 = function (arg0, arg1, arg2) {
|
|
4163
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
4164
|
+
};
|
|
4165
|
+
imports.wbg.__wbg_length_c20a40f15020d68a = function (arg0) {
|
|
4166
|
+
const ret = getObject(arg0).length;
|
|
4167
|
+
return ret;
|
|
4168
|
+
};
|
|
4169
|
+
imports.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function (arg0) {
|
|
4170
|
+
let result;
|
|
4171
|
+
try {
|
|
4172
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
4173
|
+
}
|
|
4174
|
+
catch (_) {
|
|
4175
|
+
result = false;
|
|
4176
|
+
}
|
|
4177
|
+
const ret = result;
|
|
4178
|
+
return ret;
|
|
4179
|
+
};
|
|
4180
|
+
imports.wbg.__wbg_newwithlength_e9b4878cebadb3d3 = function (arg0) {
|
|
4181
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
4182
|
+
return addHeapObject(ret);
|
|
4183
|
+
};
|
|
4184
|
+
imports.wbg.__wbg_subarray_a1f73cd4b5b42fe1 = function (arg0, arg1, arg2) {
|
|
4185
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
4186
|
+
return addHeapObject(ret);
|
|
4187
|
+
};
|
|
4188
|
+
imports.wbg.__wbg_has_0af94d20077affa2 = function () {
|
|
4189
|
+
return handleError(function (arg0, arg1) {
|
|
4190
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
4191
|
+
return ret;
|
|
4192
|
+
}, arguments);
|
|
4193
|
+
};
|
|
4194
|
+
imports.wbg.__wbg_set_1f9b04f170055d33 = function () {
|
|
4195
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
4196
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
4197
|
+
return ret;
|
|
4198
|
+
}, arguments);
|
|
4199
|
+
};
|
|
4200
|
+
imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function () {
|
|
4201
|
+
return handleError(function (arg0) {
|
|
4202
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
4203
|
+
return addHeapObject(ret);
|
|
4204
|
+
}, arguments);
|
|
4205
|
+
};
|
|
4206
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
|
|
4207
|
+
const v = getObject(arg1);
|
|
4208
|
+
const ret = typeof v === 'bigint' ? v : undefined;
|
|
4209
|
+
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
|
|
4210
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
4211
|
+
};
|
|
4212
|
+
imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
|
|
4213
|
+
const ret = debugString(getObject(arg1));
|
|
4214
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
4215
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4216
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
4217
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
4218
|
+
};
|
|
4219
|
+
imports.wbg.__wbindgen_throw = function (arg0, arg1) {
|
|
4220
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
4221
|
+
};
|
|
4222
|
+
imports.wbg.__wbindgen_memory = function () {
|
|
4223
|
+
const ret = wasm.memory;
|
|
4224
|
+
return addHeapObject(ret);
|
|
4225
|
+
};
|
|
4226
|
+
imports.wbg.__wbindgen_closure_wrapper3897 = function (arg0, arg1, arg2) {
|
|
4227
|
+
const ret = makeMutClosure(arg0, arg1, 699, __wbg_adapter_50);
|
|
4228
|
+
return addHeapObject(ret);
|
|
4229
|
+
};
|
|
4230
|
+
imports.wbg.__wbindgen_closure_wrapper7350 = function (arg0, arg1, arg2) {
|
|
4231
|
+
const ret = makeMutClosure(arg0, arg1, 1724, __wbg_adapter_53);
|
|
4232
|
+
return addHeapObject(ret);
|
|
4233
|
+
};
|
|
4234
|
+
return imports;
|
|
4235
|
+
}
|
|
4236
|
+
function __wbg_init_memory(imports, maybe_memory) { }
|
|
4237
|
+
function __wbg_finalize_init(instance, module) {
|
|
4238
|
+
wasm = instance.exports;
|
|
4239
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
4240
|
+
cachedBigInt64Memory0 = null;
|
|
4241
|
+
cachedFloat64Memory0 = null;
|
|
4242
|
+
cachedInt32Memory0 = null;
|
|
4243
|
+
cachedUint32Memory0 = null;
|
|
4244
|
+
cachedUint8Memory0 = null;
|
|
4245
|
+
return wasm;
|
|
4246
|
+
}
|
|
4247
|
+
function initSync(module) {
|
|
4248
|
+
if (wasm !== undefined)
|
|
4249
|
+
return wasm;
|
|
4250
|
+
const imports = __wbg_get_imports();
|
|
4251
|
+
__wbg_init_memory(imports);
|
|
4252
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
4253
|
+
module = new WebAssembly.Module(module);
|
|
4254
|
+
}
|
|
4255
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
4256
|
+
return __wbg_finalize_init(instance, module);
|
|
4257
|
+
}
|
|
4258
|
+
async function __wbg_init(input) {
|
|
4259
|
+
if (wasm !== undefined)
|
|
4260
|
+
return wasm;
|
|
4261
|
+
if (typeof input === 'undefined') {
|
|
4262
|
+
//input = new URL('zklink-sdk-web_bg.wasm', import.meta.url);
|
|
4263
|
+
input = 'https://qa.omni.apex.exchange/api/v3/download/zklink-sdk-web_bg.wasm';
|
|
4264
|
+
}
|
|
4265
|
+
const imports = __wbg_get_imports();
|
|
4266
|
+
if (typeof input === 'string' ||
|
|
4267
|
+
(typeof Request === 'function' && input instanceof Request) ||
|
|
4268
|
+
(typeof URL === 'function' && input instanceof URL)) {
|
|
4269
|
+
input = fetch(input);
|
|
4270
|
+
}
|
|
4271
|
+
__wbg_init_memory(imports);
|
|
4272
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
4273
|
+
return __wbg_finalize_init(instance, module);
|
|
4274
|
+
}
|
|
4275
|
+
export { initSync };
|
|
4276
|
+
export default __wbg_init;
|