@wgb5445/aptos-intent-npm 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/aptos_intent.d.ts +138 -0
- package/dist/cjs/entry.js +818 -0
- package/dist/esm/entry.js +812 -1
- package/package.json +2 -1
package/dist/cjs/entry.js
CHANGED
@@ -1,7 +1,825 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
let wasm;
|
4
|
+
|
5
|
+
const heap = new Array(128).fill(undefined);
|
6
|
+
|
7
|
+
heap.push(undefined, null, true, false);
|
8
|
+
|
9
|
+
function getObject(idx) { return heap[idx]; }
|
10
|
+
|
11
|
+
let heap_next = heap.length;
|
12
|
+
|
13
|
+
function dropObject(idx) {
|
14
|
+
if (idx < 132) return;
|
15
|
+
heap[idx] = heap_next;
|
16
|
+
heap_next = idx;
|
17
|
+
}
|
18
|
+
|
19
|
+
function takeObject(idx) {
|
20
|
+
const ret = getObject(idx);
|
21
|
+
dropObject(idx);
|
22
|
+
return ret;
|
23
|
+
}
|
24
|
+
|
25
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
26
|
+
|
27
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }
|
28
|
+
let cachedUint8Memory0 = null;
|
29
|
+
|
30
|
+
function getUint8Memory0() {
|
31
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
32
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
33
|
+
}
|
34
|
+
return cachedUint8Memory0;
|
35
|
+
}
|
36
|
+
|
37
|
+
function getStringFromWasm0(ptr, len) {
|
38
|
+
ptr = ptr >>> 0;
|
39
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
40
|
+
}
|
41
|
+
|
42
|
+
function addHeapObject(obj) {
|
43
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
44
|
+
const idx = heap_next;
|
45
|
+
heap_next = heap[idx];
|
46
|
+
|
47
|
+
heap[idx] = obj;
|
48
|
+
return idx;
|
49
|
+
}
|
50
|
+
|
51
|
+
let WASM_VECTOR_LEN = 0;
|
52
|
+
|
53
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
54
|
+
|
55
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
56
|
+
? function (arg, view) {
|
57
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
58
|
+
}
|
59
|
+
: function (arg, view) {
|
60
|
+
const buf = cachedTextEncoder.encode(arg);
|
61
|
+
view.set(buf);
|
62
|
+
return {
|
63
|
+
read: arg.length,
|
64
|
+
written: buf.length
|
65
|
+
};
|
66
|
+
});
|
67
|
+
|
68
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
69
|
+
|
70
|
+
if (realloc === undefined) {
|
71
|
+
const buf = cachedTextEncoder.encode(arg);
|
72
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
73
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
74
|
+
WASM_VECTOR_LEN = buf.length;
|
75
|
+
return ptr;
|
76
|
+
}
|
77
|
+
|
78
|
+
let len = arg.length;
|
79
|
+
let ptr = malloc(len, 1) >>> 0;
|
80
|
+
|
81
|
+
const mem = getUint8Memory0();
|
82
|
+
|
83
|
+
let offset = 0;
|
84
|
+
|
85
|
+
for (; offset < len; offset++) {
|
86
|
+
const code = arg.charCodeAt(offset);
|
87
|
+
if (code > 0x7F) break;
|
88
|
+
mem[ptr + offset] = code;
|
89
|
+
}
|
90
|
+
|
91
|
+
if (offset !== len) {
|
92
|
+
if (offset !== 0) {
|
93
|
+
arg = arg.slice(offset);
|
94
|
+
}
|
95
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
96
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
97
|
+
const ret = encodeString(arg, view);
|
98
|
+
|
99
|
+
offset += ret.written;
|
100
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
101
|
+
}
|
102
|
+
|
103
|
+
WASM_VECTOR_LEN = offset;
|
104
|
+
return ptr;
|
105
|
+
}
|
106
|
+
|
107
|
+
function isLikeNone(x) {
|
108
|
+
return x === undefined || x === null;
|
109
|
+
}
|
110
|
+
|
111
|
+
let cachedInt32Memory0 = null;
|
112
|
+
|
113
|
+
function getInt32Memory0() {
|
114
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
115
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
116
|
+
}
|
117
|
+
return cachedInt32Memory0;
|
118
|
+
}
|
119
|
+
|
120
|
+
function debugString(val) {
|
121
|
+
// primitive types
|
122
|
+
const type = typeof val;
|
123
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
124
|
+
return `${val}`;
|
125
|
+
}
|
126
|
+
if (type == 'string') {
|
127
|
+
return `"${val}"`;
|
128
|
+
}
|
129
|
+
if (type == 'symbol') {
|
130
|
+
const description = val.description;
|
131
|
+
if (description == null) {
|
132
|
+
return 'Symbol';
|
133
|
+
} else {
|
134
|
+
return `Symbol(${description})`;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
if (type == 'function') {
|
138
|
+
const name = val.name;
|
139
|
+
if (typeof name == 'string' && name.length > 0) {
|
140
|
+
return `Function(${name})`;
|
141
|
+
} else {
|
142
|
+
return 'Function';
|
143
|
+
}
|
144
|
+
}
|
145
|
+
// objects
|
146
|
+
if (Array.isArray(val)) {
|
147
|
+
const length = val.length;
|
148
|
+
let debug = '[';
|
149
|
+
if (length > 0) {
|
150
|
+
debug += debugString(val[0]);
|
151
|
+
}
|
152
|
+
for(let i = 1; i < length; i++) {
|
153
|
+
debug += ', ' + debugString(val[i]);
|
154
|
+
}
|
155
|
+
debug += ']';
|
156
|
+
return debug;
|
157
|
+
}
|
158
|
+
// Test for built-in
|
159
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
160
|
+
let className;
|
161
|
+
if (builtInMatches.length > 1) {
|
162
|
+
className = builtInMatches[1];
|
163
|
+
} else {
|
164
|
+
// Failed to match the standard '[object ClassName]'
|
165
|
+
return toString.call(val);
|
166
|
+
}
|
167
|
+
if (className == 'Object') {
|
168
|
+
// we're a user defined class or Object
|
169
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
170
|
+
// easier than looping through ownProperties of `val`.
|
171
|
+
try {
|
172
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
173
|
+
} catch (_) {
|
174
|
+
return 'Object';
|
175
|
+
}
|
176
|
+
}
|
177
|
+
// errors
|
178
|
+
if (val instanceof Error) {
|
179
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
180
|
+
}
|
181
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
182
|
+
return className;
|
183
|
+
}
|
184
|
+
|
185
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
186
|
+
? { register: () => {}, unregister: () => {} }
|
187
|
+
: new FinalizationRegistry(state => {
|
188
|
+
wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b);
|
189
|
+
});
|
190
|
+
|
191
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
192
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
193
|
+
const real = (...args) => {
|
194
|
+
// First up with a closure we increment the internal reference
|
195
|
+
// count. This ensures that the Rust closure environment won't
|
196
|
+
// be deallocated while we're invoking it.
|
197
|
+
state.cnt++;
|
198
|
+
const a = state.a;
|
199
|
+
state.a = 0;
|
200
|
+
try {
|
201
|
+
return f(a, state.b, ...args);
|
202
|
+
} finally {
|
203
|
+
if (--state.cnt === 0) {
|
204
|
+
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
205
|
+
CLOSURE_DTORS.unregister(state);
|
206
|
+
} else {
|
207
|
+
state.a = a;
|
208
|
+
}
|
209
|
+
}
|
210
|
+
};
|
211
|
+
real.original = state;
|
212
|
+
CLOSURE_DTORS.register(real, state, state);
|
213
|
+
return real;
|
214
|
+
}
|
215
|
+
function __wbg_adapter_24(arg0, arg1, arg2) {
|
216
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h09acdaa8b02601d5(arg0, arg1, addHeapObject(arg2));
|
217
|
+
}
|
218
|
+
|
219
|
+
let cachedUint32Memory0 = null;
|
220
|
+
|
221
|
+
function getUint32Memory0() {
|
222
|
+
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
223
|
+
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
224
|
+
}
|
225
|
+
return cachedUint32Memory0;
|
226
|
+
}
|
227
|
+
|
228
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
229
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
230
|
+
const mem = getUint32Memory0();
|
231
|
+
for (let i = 0; i < array.length; i++) {
|
232
|
+
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
233
|
+
}
|
234
|
+
WASM_VECTOR_LEN = array.length;
|
235
|
+
return ptr;
|
236
|
+
}
|
237
|
+
|
238
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
239
|
+
ptr = ptr >>> 0;
|
240
|
+
const mem = getUint32Memory0();
|
241
|
+
const slice = mem.subarray(ptr / 4, ptr / 4 + len);
|
242
|
+
const result = [];
|
243
|
+
for (let i = 0; i < slice.length; i++) {
|
244
|
+
result.push(takeObject(slice[i]));
|
245
|
+
}
|
246
|
+
return result;
|
247
|
+
}
|
248
|
+
|
249
|
+
function getArrayU8FromWasm0(ptr, len) {
|
250
|
+
ptr = ptr >>> 0;
|
251
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
252
|
+
}
|
253
|
+
|
254
|
+
function passArray8ToWasm0(arg, malloc) {
|
255
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
256
|
+
getUint8Memory0().set(arg, ptr / 1);
|
257
|
+
WASM_VECTOR_LEN = arg.length;
|
258
|
+
return ptr;
|
259
|
+
}
|
260
|
+
|
261
|
+
function handleError(f, args) {
|
262
|
+
try {
|
263
|
+
return f.apply(this, args);
|
264
|
+
} catch (e) {
|
265
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
266
|
+
}
|
267
|
+
}
|
268
|
+
function __wbg_adapter_87(arg0, arg1, arg2, arg3) {
|
269
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4c0838795c3445c5(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
270
|
+
}
|
271
|
+
|
272
|
+
/**
|
273
|
+
*/
|
274
|
+
const ArgumentOperation = Object.freeze({ Move:0,"0":"Move",Copy:1,"1":"Copy",Borrow:2,"2":"Borrow",BorrowMut:3,"3":"BorrowMut", });
|
275
|
+
/**
|
276
|
+
* Arguments for each function.
|
277
|
+
*/
|
278
|
+
const BatchArgumentType = Object.freeze({ Raw:0,"0":"Raw",Signer:1,"1":"Signer",PreviousResult:2,"2":"PreviousResult", });
|
279
|
+
|
280
|
+
const BatchArgumentFinalization = (typeof FinalizationRegistry === 'undefined')
|
281
|
+
? { register: () => {}, unregister: () => {} }
|
282
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchargument_free(ptr >>> 0));
|
283
|
+
/**
|
284
|
+
* Arguments for each function. Wasm bindgen only support C-style enum so use option to work around.
|
285
|
+
*/
|
286
|
+
class BatchArgument {
|
287
|
+
|
288
|
+
static __wrap(ptr) {
|
289
|
+
ptr = ptr >>> 0;
|
290
|
+
const obj = Object.create(BatchArgument.prototype);
|
291
|
+
obj.__wbg_ptr = ptr;
|
292
|
+
BatchArgumentFinalization.register(obj, obj.__wbg_ptr, obj);
|
293
|
+
return obj;
|
294
|
+
}
|
295
|
+
|
296
|
+
static __unwrap(jsValue) {
|
297
|
+
if (!(jsValue instanceof BatchArgument)) {
|
298
|
+
return 0;
|
299
|
+
}
|
300
|
+
return jsValue.__destroy_into_raw();
|
301
|
+
}
|
302
|
+
|
303
|
+
__destroy_into_raw() {
|
304
|
+
const ptr = this.__wbg_ptr;
|
305
|
+
this.__wbg_ptr = 0;
|
306
|
+
BatchArgumentFinalization.unregister(this);
|
307
|
+
return ptr;
|
308
|
+
}
|
309
|
+
|
310
|
+
free() {
|
311
|
+
const ptr = this.__destroy_into_raw();
|
312
|
+
wasm.__wbg_batchargument_free(ptr);
|
313
|
+
}
|
314
|
+
/**
|
315
|
+
* @param {Uint8Array} bytes
|
316
|
+
* @returns {BatchArgument}
|
317
|
+
*/
|
318
|
+
static new_bytes(bytes) {
|
319
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
320
|
+
const len0 = WASM_VECTOR_LEN;
|
321
|
+
const ret = wasm.batchargument_new_bytes(ptr0, len0);
|
322
|
+
return BatchArgument.__wrap(ret);
|
323
|
+
}
|
324
|
+
/**
|
325
|
+
* @param {number} signer_idx
|
326
|
+
* @returns {BatchArgument}
|
327
|
+
*/
|
328
|
+
static new_signer(signer_idx) {
|
329
|
+
const ret = wasm.batchargument_new_signer(signer_idx);
|
330
|
+
return BatchArgument.__wrap(ret);
|
331
|
+
}
|
332
|
+
/**
|
333
|
+
* @returns {BatchArgument}
|
334
|
+
*/
|
335
|
+
borrow() {
|
336
|
+
try {
|
337
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
338
|
+
wasm.batchargument_borrow(retptr, this.__wbg_ptr);
|
339
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
340
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
341
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
342
|
+
if (r2) {
|
343
|
+
throw takeObject(r1);
|
344
|
+
}
|
345
|
+
return BatchArgument.__wrap(r0);
|
346
|
+
} finally {
|
347
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
348
|
+
}
|
349
|
+
}
|
350
|
+
/**
|
351
|
+
* @returns {BatchArgument}
|
352
|
+
*/
|
353
|
+
borrow_mut() {
|
354
|
+
try {
|
355
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
356
|
+
wasm.batchargument_borrow_mut(retptr, this.__wbg_ptr);
|
357
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
358
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
359
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
360
|
+
if (r2) {
|
361
|
+
throw takeObject(r1);
|
362
|
+
}
|
363
|
+
return BatchArgument.__wrap(r0);
|
364
|
+
} finally {
|
365
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
366
|
+
}
|
367
|
+
}
|
368
|
+
/**
|
369
|
+
* @returns {BatchArgument}
|
370
|
+
*/
|
371
|
+
copy() {
|
372
|
+
try {
|
373
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
374
|
+
wasm.batchargument_copy(retptr, this.__wbg_ptr);
|
375
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
376
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
377
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
378
|
+
if (r2) {
|
379
|
+
throw takeObject(r1);
|
380
|
+
}
|
381
|
+
return BatchArgument.__wrap(r0);
|
382
|
+
} finally {
|
383
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
384
|
+
}
|
385
|
+
}
|
386
|
+
}
|
387
|
+
|
388
|
+
const BatchedFunctionCallFinalization = (typeof FinalizationRegistry === 'undefined')
|
389
|
+
? { register: () => {}, unregister: () => {} }
|
390
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedfunctioncall_free(ptr >>> 0));
|
391
|
+
/**
|
392
|
+
* Call a Move entry function.
|
393
|
+
*/
|
394
|
+
class BatchedFunctionCall {
|
395
|
+
|
396
|
+
__destroy_into_raw() {
|
397
|
+
const ptr = this.__wbg_ptr;
|
398
|
+
this.__wbg_ptr = 0;
|
399
|
+
BatchedFunctionCallFinalization.unregister(this);
|
400
|
+
return ptr;
|
401
|
+
}
|
402
|
+
|
403
|
+
free() {
|
404
|
+
const ptr = this.__destroy_into_raw();
|
405
|
+
wasm.__wbg_batchedfunctioncall_free(ptr);
|
406
|
+
}
|
407
|
+
}
|
408
|
+
|
409
|
+
const BatchedFunctionCallBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
410
|
+
? { register: () => {}, unregister: () => {} }
|
411
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_batchedfunctioncallbuilder_free(ptr >>> 0));
|
412
|
+
/**
|
413
|
+
*/
|
414
|
+
class BatchedFunctionCallBuilder {
|
415
|
+
|
416
|
+
static __wrap(ptr) {
|
417
|
+
ptr = ptr >>> 0;
|
418
|
+
const obj = Object.create(BatchedFunctionCallBuilder.prototype);
|
419
|
+
obj.__wbg_ptr = ptr;
|
420
|
+
BatchedFunctionCallBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
421
|
+
return obj;
|
422
|
+
}
|
423
|
+
|
424
|
+
__destroy_into_raw() {
|
425
|
+
const ptr = this.__wbg_ptr;
|
426
|
+
this.__wbg_ptr = 0;
|
427
|
+
BatchedFunctionCallBuilderFinalization.unregister(this);
|
428
|
+
return ptr;
|
429
|
+
}
|
430
|
+
|
431
|
+
free() {
|
432
|
+
const ptr = this.__destroy_into_raw();
|
433
|
+
wasm.__wbg_batchedfunctioncallbuilder_free(ptr);
|
434
|
+
}
|
435
|
+
/**
|
436
|
+
* @returns {BatchedFunctionCallBuilder}
|
437
|
+
*/
|
438
|
+
static single_signer() {
|
439
|
+
const ret = wasm.batchedfunctioncallbuilder_single_signer();
|
440
|
+
return BatchedFunctionCallBuilder.__wrap(ret);
|
441
|
+
}
|
442
|
+
/**
|
443
|
+
* @param {number} signer_count
|
444
|
+
* @returns {BatchedFunctionCallBuilder}
|
445
|
+
*/
|
446
|
+
static multi_signer(signer_count) {
|
447
|
+
const ret = wasm.batchedfunctioncallbuilder_multi_signer(signer_count);
|
448
|
+
return BatchedFunctionCallBuilder.__wrap(ret);
|
449
|
+
}
|
450
|
+
/**
|
451
|
+
* @param {string} module
|
452
|
+
* @param {string} _function
|
453
|
+
* @param {(string)[]} ty_args
|
454
|
+
* @param {(BatchArgument)[]} args
|
455
|
+
* @returns {(BatchArgument)[]}
|
456
|
+
*/
|
457
|
+
add_batched_call(module, _function, ty_args, args) {
|
458
|
+
try {
|
459
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
460
|
+
const ptr0 = passStringToWasm0(module, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
461
|
+
const len0 = WASM_VECTOR_LEN;
|
462
|
+
const ptr1 = passStringToWasm0(_function, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
463
|
+
const len1 = WASM_VECTOR_LEN;
|
464
|
+
const ptr2 = passArrayJsValueToWasm0(ty_args, wasm.__wbindgen_malloc);
|
465
|
+
const len2 = WASM_VECTOR_LEN;
|
466
|
+
const ptr3 = passArrayJsValueToWasm0(args, wasm.__wbindgen_malloc);
|
467
|
+
const len3 = WASM_VECTOR_LEN;
|
468
|
+
wasm.batchedfunctioncallbuilder_add_batched_call(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
469
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
470
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
471
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
472
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
473
|
+
if (r3) {
|
474
|
+
throw takeObject(r2);
|
475
|
+
}
|
476
|
+
var v5 = getArrayJsValueFromWasm0(r0, r1).slice();
|
477
|
+
wasm.__wbindgen_free(r0, r1 * 4, 4);
|
478
|
+
return v5;
|
479
|
+
} finally {
|
480
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
481
|
+
}
|
482
|
+
}
|
483
|
+
/**
|
484
|
+
* @returns {Uint8Array}
|
485
|
+
*/
|
486
|
+
generate_batched_calls() {
|
487
|
+
try {
|
488
|
+
const ptr = this.__destroy_into_raw();
|
489
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
490
|
+
wasm.batchedfunctioncallbuilder_generate_batched_calls(retptr, ptr);
|
491
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
492
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
493
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
494
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
495
|
+
if (r3) {
|
496
|
+
throw takeObject(r2);
|
497
|
+
}
|
498
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
499
|
+
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
500
|
+
return v1;
|
501
|
+
} finally {
|
502
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
503
|
+
}
|
504
|
+
}
|
505
|
+
/**
|
506
|
+
* @param {string} network
|
507
|
+
* @param {string} module_name
|
508
|
+
* @returns {Promise<void>}
|
509
|
+
*/
|
510
|
+
load_module(network, module_name) {
|
511
|
+
const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
512
|
+
const len0 = WASM_VECTOR_LEN;
|
513
|
+
const ptr1 = passStringToWasm0(module_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
514
|
+
const len1 = WASM_VECTOR_LEN;
|
515
|
+
const ret = wasm.batchedfunctioncallbuilder_load_module(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
516
|
+
return takeObject(ret);
|
517
|
+
}
|
518
|
+
}
|
519
|
+
|
520
|
+
const PreviousResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
521
|
+
? { register: () => {}, unregister: () => {} }
|
522
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_previousresult_free(ptr >>> 0));
|
523
|
+
/**
|
524
|
+
*/
|
525
|
+
class PreviousResult {
|
526
|
+
|
527
|
+
__destroy_into_raw() {
|
528
|
+
const ptr = this.__wbg_ptr;
|
529
|
+
this.__wbg_ptr = 0;
|
530
|
+
PreviousResultFinalization.unregister(this);
|
531
|
+
return ptr;
|
532
|
+
}
|
533
|
+
|
534
|
+
free() {
|
535
|
+
const ptr = this.__destroy_into_raw();
|
536
|
+
wasm.__wbg_previousresult_free(ptr);
|
537
|
+
}
|
538
|
+
}
|
539
|
+
|
540
|
+
function __wbg_get_imports() {
|
541
|
+
const imports = {};
|
542
|
+
imports.wbg = {};
|
543
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
544
|
+
takeObject(arg0);
|
545
|
+
};
|
546
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
547
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
548
|
+
return addHeapObject(ret);
|
549
|
+
};
|
550
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
551
|
+
const obj = getObject(arg1);
|
552
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
553
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
554
|
+
var len1 = WASM_VECTOR_LEN;
|
555
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
556
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
557
|
+
};
|
558
|
+
imports.wbg.__wbg_batchargument_new = function(arg0) {
|
559
|
+
const ret = BatchArgument.__wrap(arg0);
|
560
|
+
return addHeapObject(ret);
|
561
|
+
};
|
562
|
+
imports.wbg.__wbg_batchargument_unwrap = function(arg0) {
|
563
|
+
const ret = BatchArgument.__unwrap(takeObject(arg0));
|
564
|
+
return ret;
|
565
|
+
};
|
566
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
567
|
+
const obj = takeObject(arg0).original;
|
568
|
+
if (obj.cnt-- == 1) {
|
569
|
+
obj.a = 0;
|
570
|
+
return true;
|
571
|
+
}
|
572
|
+
const ret = false;
|
573
|
+
return ret;
|
574
|
+
};
|
575
|
+
imports.wbg.__wbg_fetch_1e4e8ed1f64c7e28 = function(arg0) {
|
576
|
+
const ret = fetch(getObject(arg0));
|
577
|
+
return addHeapObject(ret);
|
578
|
+
};
|
579
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
580
|
+
const ret = getObject(arg0);
|
581
|
+
return addHeapObject(ret);
|
582
|
+
};
|
583
|
+
imports.wbg.__wbg_queueMicrotask_481971b0d87f3dd4 = function(arg0) {
|
584
|
+
queueMicrotask(getObject(arg0));
|
585
|
+
};
|
586
|
+
imports.wbg.__wbg_queueMicrotask_3cbae2ec6b6cd3d6 = function(arg0) {
|
587
|
+
const ret = getObject(arg0).queueMicrotask;
|
588
|
+
return addHeapObject(ret);
|
589
|
+
};
|
590
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
591
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
592
|
+
return ret;
|
593
|
+
};
|
594
|
+
imports.wbg.__wbg_fetch_693453ca3f88c055 = function(arg0, arg1) {
|
595
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
596
|
+
return addHeapObject(ret);
|
597
|
+
};
|
598
|
+
imports.wbg.__wbg_newwithstrandinit_f581dff0d19a8b03 = function() { return handleError(function (arg0, arg1, arg2) {
|
599
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
600
|
+
return addHeapObject(ret);
|
601
|
+
}, arguments) };
|
602
|
+
imports.wbg.__wbg_signal_3c701f5f40a5f08d = function(arg0) {
|
603
|
+
const ret = getObject(arg0).signal;
|
604
|
+
return addHeapObject(ret);
|
605
|
+
};
|
606
|
+
imports.wbg.__wbg_new_0ae46f44b7485bb2 = function() { return handleError(function () {
|
607
|
+
const ret = new AbortController();
|
608
|
+
return addHeapObject(ret);
|
609
|
+
}, arguments) };
|
610
|
+
imports.wbg.__wbg_abort_2c4fb490d878d2b2 = function(arg0) {
|
611
|
+
getObject(arg0).abort();
|
612
|
+
};
|
613
|
+
imports.wbg.__wbg_new_7a20246daa6eec7e = function() { return handleError(function () {
|
614
|
+
const ret = new Headers();
|
615
|
+
return addHeapObject(ret);
|
616
|
+
}, arguments) };
|
617
|
+
imports.wbg.__wbg_append_aa3f462f9e2b5ff2 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
618
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
619
|
+
}, arguments) };
|
620
|
+
imports.wbg.__wbg_instanceof_Response_4c3b1446206114d1 = function(arg0) {
|
621
|
+
let result;
|
622
|
+
try {
|
623
|
+
result = getObject(arg0) instanceof Response;
|
624
|
+
} catch (_) {
|
625
|
+
result = false;
|
626
|
+
}
|
627
|
+
const ret = result;
|
628
|
+
return ret;
|
629
|
+
};
|
630
|
+
imports.wbg.__wbg_url_83a6a4f65f7a2b38 = function(arg0, arg1) {
|
631
|
+
const ret = getObject(arg1).url;
|
632
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
633
|
+
const len1 = WASM_VECTOR_LEN;
|
634
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
635
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
636
|
+
};
|
637
|
+
imports.wbg.__wbg_status_d6d47ad2837621eb = function(arg0) {
|
638
|
+
const ret = getObject(arg0).status;
|
639
|
+
return ret;
|
640
|
+
};
|
641
|
+
imports.wbg.__wbg_headers_24def508a7518df9 = function(arg0) {
|
642
|
+
const ret = getObject(arg0).headers;
|
643
|
+
return addHeapObject(ret);
|
644
|
+
};
|
645
|
+
imports.wbg.__wbg_text_668782292b0bc561 = function() { return handleError(function (arg0) {
|
646
|
+
const ret = getObject(arg0).text();
|
647
|
+
return addHeapObject(ret);
|
648
|
+
}, arguments) };
|
649
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
650
|
+
const val = getObject(arg0);
|
651
|
+
const ret = typeof(val) === 'object' && val !== null;
|
652
|
+
return ret;
|
653
|
+
};
|
654
|
+
imports.wbg.__wbg_newnoargs_e258087cd0daa0ea = function(arg0, arg1) {
|
655
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
656
|
+
return addHeapObject(ret);
|
657
|
+
};
|
658
|
+
imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) {
|
659
|
+
const ret = getObject(arg0).next;
|
660
|
+
return addHeapObject(ret);
|
661
|
+
};
|
662
|
+
imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) {
|
663
|
+
const ret = getObject(arg0).next();
|
664
|
+
return addHeapObject(ret);
|
665
|
+
}, arguments) };
|
666
|
+
imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
|
667
|
+
const ret = getObject(arg0).done;
|
668
|
+
return ret;
|
669
|
+
};
|
670
|
+
imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
|
671
|
+
const ret = getObject(arg0).value;
|
672
|
+
return addHeapObject(ret);
|
673
|
+
};
|
674
|
+
imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() {
|
675
|
+
const ret = Symbol.iterator;
|
676
|
+
return addHeapObject(ret);
|
677
|
+
};
|
678
|
+
imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
|
679
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
680
|
+
return addHeapObject(ret);
|
681
|
+
}, arguments) };
|
682
|
+
imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
|
683
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
684
|
+
return addHeapObject(ret);
|
685
|
+
}, arguments) };
|
686
|
+
imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() {
|
687
|
+
const ret = new Object();
|
688
|
+
return addHeapObject(ret);
|
689
|
+
};
|
690
|
+
imports.wbg.__wbg_self_ce0dbfc45cf2f5be = function() { return handleError(function () {
|
691
|
+
const ret = self.self;
|
692
|
+
return addHeapObject(ret);
|
693
|
+
}, arguments) };
|
694
|
+
imports.wbg.__wbg_window_c6fb939a7f436783 = function() { return handleError(function () {
|
695
|
+
const ret = window.window;
|
696
|
+
return addHeapObject(ret);
|
697
|
+
}, arguments) };
|
698
|
+
imports.wbg.__wbg_globalThis_d1e6af4856ba331b = function() { return handleError(function () {
|
699
|
+
const ret = globalThis.globalThis;
|
700
|
+
return addHeapObject(ret);
|
701
|
+
}, arguments) };
|
702
|
+
imports.wbg.__wbg_global_207b558942527489 = function() { return handleError(function () {
|
703
|
+
const ret = global.global;
|
704
|
+
return addHeapObject(ret);
|
705
|
+
}, arguments) };
|
706
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
707
|
+
const ret = getObject(arg0) === undefined;
|
708
|
+
return ret;
|
709
|
+
};
|
710
|
+
imports.wbg.__wbg_call_b3ca7c6051f9bec1 = function() { return handleError(function (arg0, arg1, arg2) {
|
711
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
712
|
+
return addHeapObject(ret);
|
713
|
+
}, arguments) };
|
714
|
+
imports.wbg.__wbg_new_81740750da40724f = function(arg0, arg1) {
|
715
|
+
try {
|
716
|
+
var state0 = {a: arg0, b: arg1};
|
717
|
+
var cb0 = (arg0, arg1) => {
|
718
|
+
const a = state0.a;
|
719
|
+
state0.a = 0;
|
720
|
+
try {
|
721
|
+
return __wbg_adapter_87(a, state0.b, arg0, arg1);
|
722
|
+
} finally {
|
723
|
+
state0.a = a;
|
724
|
+
}
|
725
|
+
};
|
726
|
+
const ret = new Promise(cb0);
|
727
|
+
return addHeapObject(ret);
|
728
|
+
} finally {
|
729
|
+
state0.a = state0.b = 0;
|
730
|
+
}
|
731
|
+
};
|
732
|
+
imports.wbg.__wbg_resolve_b0083a7967828ec8 = function(arg0) {
|
733
|
+
const ret = Promise.resolve(getObject(arg0));
|
734
|
+
return addHeapObject(ret);
|
735
|
+
};
|
736
|
+
imports.wbg.__wbg_then_0c86a60e8fcfe9f6 = function(arg0, arg1) {
|
737
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
738
|
+
return addHeapObject(ret);
|
739
|
+
};
|
740
|
+
imports.wbg.__wbg_then_a73caa9a87991566 = function(arg0, arg1, arg2) {
|
741
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
742
|
+
return addHeapObject(ret);
|
743
|
+
};
|
744
|
+
imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
|
745
|
+
const ret = getObject(arg0).buffer;
|
746
|
+
return addHeapObject(ret);
|
747
|
+
};
|
748
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_aa4a17c33a06e5cb = function(arg0, arg1, arg2) {
|
749
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
750
|
+
return addHeapObject(ret);
|
751
|
+
};
|
752
|
+
imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
|
753
|
+
const ret = new Uint8Array(getObject(arg0));
|
754
|
+
return addHeapObject(ret);
|
755
|
+
};
|
756
|
+
imports.wbg.__wbg_stringify_8887fe74e1c50d81 = function() { return handleError(function (arg0) {
|
757
|
+
const ret = JSON.stringify(getObject(arg0));
|
758
|
+
return addHeapObject(ret);
|
759
|
+
}, arguments) };
|
760
|
+
imports.wbg.__wbg_has_0af94d20077affa2 = function() { return handleError(function (arg0, arg1) {
|
761
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
762
|
+
return ret;
|
763
|
+
}, arguments) };
|
764
|
+
imports.wbg.__wbg_set_1f9b04f170055d33 = function() { return handleError(function (arg0, arg1, arg2) {
|
765
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
766
|
+
return ret;
|
767
|
+
}, arguments) };
|
768
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
769
|
+
const ret = debugString(getObject(arg1));
|
770
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
771
|
+
const len1 = WASM_VECTOR_LEN;
|
772
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
773
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
774
|
+
};
|
775
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
776
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
777
|
+
};
|
778
|
+
imports.wbg.__wbindgen_memory = function() {
|
779
|
+
const ret = wasm.memory;
|
780
|
+
return addHeapObject(ret);
|
781
|
+
};
|
782
|
+
imports.wbg.__wbindgen_closure_wrapper468 = function(arg0, arg1, arg2) {
|
783
|
+
const ret = makeMutClosure(arg0, arg1, 195, __wbg_adapter_24);
|
784
|
+
return addHeapObject(ret);
|
785
|
+
};
|
786
|
+
|
787
|
+
return imports;
|
788
|
+
}
|
789
|
+
|
790
|
+
function __wbg_finalize_init(instance, module) {
|
791
|
+
wasm = instance.exports;
|
792
|
+
cachedInt32Memory0 = null;
|
793
|
+
cachedUint32Memory0 = null;
|
794
|
+
cachedUint8Memory0 = null;
|
795
|
+
|
796
|
+
|
797
|
+
return wasm;
|
798
|
+
}
|
799
|
+
|
800
|
+
function initSync(module) {
|
801
|
+
if (wasm !== undefined) return wasm;
|
802
|
+
|
803
|
+
const imports = __wbg_get_imports();
|
804
|
+
|
805
|
+
if (!(module instanceof WebAssembly.Module)) {
|
806
|
+
module = new WebAssembly.Module(module);
|
807
|
+
}
|
808
|
+
|
809
|
+
const instance = new WebAssembly.Instance(module, imports);
|
810
|
+
|
811
|
+
return __wbg_finalize_init(instance);
|
812
|
+
}
|
813
|
+
|
3
814
|
async function get_wasm (){
|
4
815
|
return (await Promise.resolve().then(function () { return require('./aptos_intent_bg-C1GQufHE.js'); })).default()
|
5
816
|
}
|
6
817
|
|
818
|
+
exports.ArgumentOperation = ArgumentOperation;
|
819
|
+
exports.BatchArgument = BatchArgument;
|
820
|
+
exports.BatchArgumentType = BatchArgumentType;
|
821
|
+
exports.BatchedFunctionCall = BatchedFunctionCall;
|
822
|
+
exports.BatchedFunctionCallBuilder = BatchedFunctionCallBuilder;
|
823
|
+
exports.PreviousResult = PreviousResult;
|
7
824
|
exports.get_wasm = get_wasm;
|
825
|
+
exports.initSync = initSync;
|