@_koii/task-node 1.12.37
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 +49 -0
- package/dist/bincode_js.d.ts +225 -0
- package/dist/bincode_js.js +1211 -0
- package/dist/bincode_js_bg.wasm +0 -0
- package/dist/bincode_js_bg.wasm.d.ts +44 -0
- package/dist/taskNodeLib.d.ts +712 -0
- package/dist/taskNodeLib.js +5980 -0
- package/dist/taskNodeLib.mjs +5948 -0
- package/dist/zstd.wasm +0 -0
- package/package.json +116 -0
@@ -0,0 +1,1211 @@
|
|
1
|
+
let imports = {};
|
2
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
3
|
+
let wasm;
|
4
|
+
const { TextDecoder, TextEncoder } = require(`util`);
|
5
|
+
|
6
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
7
|
+
|
8
|
+
cachedTextDecoder.decode();
|
9
|
+
|
10
|
+
let cachedUint8Memory0 = null;
|
11
|
+
|
12
|
+
function getUint8Memory0() {
|
13
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
14
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
15
|
+
}
|
16
|
+
return cachedUint8Memory0;
|
17
|
+
}
|
18
|
+
|
19
|
+
function getStringFromWasm0(ptr, len) {
|
20
|
+
ptr = ptr >>> 0;
|
21
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
22
|
+
}
|
23
|
+
|
24
|
+
const heap = new Array(128).fill(undefined);
|
25
|
+
|
26
|
+
heap.push(undefined, null, true, false);
|
27
|
+
|
28
|
+
let heap_next = heap.length;
|
29
|
+
|
30
|
+
function addHeapObject(obj) {
|
31
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
32
|
+
const idx = heap_next;
|
33
|
+
heap_next = heap[idx];
|
34
|
+
|
35
|
+
heap[idx] = obj;
|
36
|
+
return idx;
|
37
|
+
}
|
38
|
+
|
39
|
+
function getObject(idx) { return heap[idx]; }
|
40
|
+
|
41
|
+
function dropObject(idx) {
|
42
|
+
if (idx < 132) return;
|
43
|
+
heap[idx] = heap_next;
|
44
|
+
heap_next = idx;
|
45
|
+
}
|
46
|
+
|
47
|
+
function takeObject(idx) {
|
48
|
+
const ret = getObject(idx);
|
49
|
+
dropObject(idx);
|
50
|
+
return ret;
|
51
|
+
}
|
52
|
+
|
53
|
+
function isLikeNone(x) {
|
54
|
+
return x === undefined || x === null;
|
55
|
+
}
|
56
|
+
|
57
|
+
let cachedFloat64Memory0 = null;
|
58
|
+
|
59
|
+
function getFloat64Memory0() {
|
60
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
61
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
62
|
+
}
|
63
|
+
return cachedFloat64Memory0;
|
64
|
+
}
|
65
|
+
|
66
|
+
let cachedInt32Memory0 = null;
|
67
|
+
|
68
|
+
function getInt32Memory0() {
|
69
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
70
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
71
|
+
}
|
72
|
+
return cachedInt32Memory0;
|
73
|
+
}
|
74
|
+
|
75
|
+
let WASM_VECTOR_LEN = 0;
|
76
|
+
|
77
|
+
let cachedTextEncoder = new TextEncoder('utf-8');
|
78
|
+
|
79
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
80
|
+
? function (arg, view) {
|
81
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
82
|
+
}
|
83
|
+
: function (arg, view) {
|
84
|
+
const buf = cachedTextEncoder.encode(arg);
|
85
|
+
view.set(buf);
|
86
|
+
return {
|
87
|
+
read: arg.length,
|
88
|
+
written: buf.length
|
89
|
+
};
|
90
|
+
});
|
91
|
+
|
92
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
93
|
+
|
94
|
+
if (realloc === undefined) {
|
95
|
+
const buf = cachedTextEncoder.encode(arg);
|
96
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
97
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
98
|
+
WASM_VECTOR_LEN = buf.length;
|
99
|
+
return ptr;
|
100
|
+
}
|
101
|
+
|
102
|
+
let len = arg.length;
|
103
|
+
let ptr = malloc(len, 1) >>> 0;
|
104
|
+
|
105
|
+
const mem = getUint8Memory0();
|
106
|
+
|
107
|
+
let offset = 0;
|
108
|
+
|
109
|
+
for (; offset < len; offset++) {
|
110
|
+
const code = arg.charCodeAt(offset);
|
111
|
+
if (code > 0x7F) break;
|
112
|
+
mem[ptr + offset] = code;
|
113
|
+
}
|
114
|
+
|
115
|
+
if (offset !== len) {
|
116
|
+
if (offset !== 0) {
|
117
|
+
arg = arg.slice(offset);
|
118
|
+
}
|
119
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
120
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
121
|
+
const ret = encodeString(arg, view);
|
122
|
+
|
123
|
+
offset += ret.written;
|
124
|
+
}
|
125
|
+
|
126
|
+
WASM_VECTOR_LEN = offset;
|
127
|
+
return ptr;
|
128
|
+
}
|
129
|
+
|
130
|
+
function debugString(val) {
|
131
|
+
// primitive types
|
132
|
+
const type = typeof val;
|
133
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
134
|
+
return `${val}`;
|
135
|
+
}
|
136
|
+
if (type == 'string') {
|
137
|
+
return `"${val}"`;
|
138
|
+
}
|
139
|
+
if (type == 'symbol') {
|
140
|
+
const description = val.description;
|
141
|
+
if (description == null) {
|
142
|
+
return 'Symbol';
|
143
|
+
} else {
|
144
|
+
return `Symbol(${description})`;
|
145
|
+
}
|
146
|
+
}
|
147
|
+
if (type == 'function') {
|
148
|
+
const name = val.name;
|
149
|
+
if (typeof name == 'string' && name.length > 0) {
|
150
|
+
return `Function(${name})`;
|
151
|
+
} else {
|
152
|
+
return 'Function';
|
153
|
+
}
|
154
|
+
}
|
155
|
+
// objects
|
156
|
+
if (Array.isArray(val)) {
|
157
|
+
const length = val.length;
|
158
|
+
let debug = '[';
|
159
|
+
if (length > 0) {
|
160
|
+
debug += debugString(val[0]);
|
161
|
+
}
|
162
|
+
for(let i = 1; i < length; i++) {
|
163
|
+
debug += ', ' + debugString(val[i]);
|
164
|
+
}
|
165
|
+
debug += ']';
|
166
|
+
return debug;
|
167
|
+
}
|
168
|
+
// Test for built-in
|
169
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
170
|
+
let className;
|
171
|
+
if (builtInMatches.length > 1) {
|
172
|
+
className = builtInMatches[1];
|
173
|
+
} else {
|
174
|
+
// Failed to match the standard '[object ClassName]'
|
175
|
+
return toString.call(val);
|
176
|
+
}
|
177
|
+
if (className == 'Object') {
|
178
|
+
// we're a user defined class or Object
|
179
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
180
|
+
// easier than looping through ownProperties of `val`.
|
181
|
+
try {
|
182
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
183
|
+
} catch (_) {
|
184
|
+
return 'Object';
|
185
|
+
}
|
186
|
+
}
|
187
|
+
// errors
|
188
|
+
if (val instanceof Error) {
|
189
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
190
|
+
}
|
191
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
192
|
+
return className;
|
193
|
+
}
|
194
|
+
/**
|
195
|
+
* @param {any} val
|
196
|
+
* @returns {any}
|
197
|
+
*/
|
198
|
+
module.exports.bincode_js_deserialize = function(val) {
|
199
|
+
const ret = wasm.bincode_js_deserialize(addHeapObject(val));
|
200
|
+
return takeObject(ret);
|
201
|
+
};
|
202
|
+
|
203
|
+
/**
|
204
|
+
* @param {any} val
|
205
|
+
* @returns {any}
|
206
|
+
*/
|
207
|
+
module.exports.borsh_bpf_js_deserialize = function(val) {
|
208
|
+
const ret = wasm.borsh_bpf_js_deserialize(addHeapObject(val));
|
209
|
+
return takeObject(ret);
|
210
|
+
};
|
211
|
+
|
212
|
+
/**
|
213
|
+
* Initialize Javascript logging and panic handler
|
214
|
+
*/
|
215
|
+
module.exports.solana_program_init = function() {
|
216
|
+
wasm.solana_program_init();
|
217
|
+
};
|
218
|
+
|
219
|
+
function _assertClass(instance, klass) {
|
220
|
+
if (!(instance instanceof klass)) {
|
221
|
+
throw new Error(`expected instance of ${klass.name}`);
|
222
|
+
}
|
223
|
+
return instance.ptr;
|
224
|
+
}
|
225
|
+
|
226
|
+
function getArrayU8FromWasm0(ptr, len) {
|
227
|
+
ptr = ptr >>> 0;
|
228
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
229
|
+
}
|
230
|
+
|
231
|
+
let cachedUint32Memory0 = null;
|
232
|
+
|
233
|
+
function getUint32Memory0() {
|
234
|
+
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
235
|
+
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
236
|
+
}
|
237
|
+
return cachedUint32Memory0;
|
238
|
+
}
|
239
|
+
|
240
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
241
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
242
|
+
const mem = getUint32Memory0();
|
243
|
+
for (let i = 0; i < array.length; i++) {
|
244
|
+
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
245
|
+
}
|
246
|
+
WASM_VECTOR_LEN = array.length;
|
247
|
+
return ptr;
|
248
|
+
}
|
249
|
+
|
250
|
+
function handleError(f, args) {
|
251
|
+
try {
|
252
|
+
return f.apply(this, args);
|
253
|
+
} catch (e) {
|
254
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
255
|
+
}
|
256
|
+
}
|
257
|
+
/**
|
258
|
+
* A hash; the 32-byte output of a hashing algorithm.
|
259
|
+
*
|
260
|
+
* This struct is used most often in `solana-sdk` and related crates to contain
|
261
|
+
* a [SHA-256] hash, but may instead contain a [blake3] hash, as created by the
|
262
|
+
* [`blake3`] module (and used in [`Message::hash`]).
|
263
|
+
*
|
264
|
+
* [SHA-256]: https://en.wikipedia.org/wiki/SHA-2
|
265
|
+
* [blake3]: https://github.com/BLAKE3-team/BLAKE3
|
266
|
+
* [`blake3`]: crate::blake3
|
267
|
+
* [`Message::hash`]: crate::message::Message::hash
|
268
|
+
*/
|
269
|
+
class Hash {
|
270
|
+
|
271
|
+
static __wrap(ptr) {
|
272
|
+
ptr = ptr >>> 0;
|
273
|
+
const obj = Object.create(Hash.prototype);
|
274
|
+
obj.__wbg_ptr = ptr;
|
275
|
+
|
276
|
+
return obj;
|
277
|
+
}
|
278
|
+
|
279
|
+
__destroy_into_raw() {
|
280
|
+
const ptr = this.__wbg_ptr;
|
281
|
+
this.__wbg_ptr = 0;
|
282
|
+
|
283
|
+
return ptr;
|
284
|
+
}
|
285
|
+
|
286
|
+
free() {
|
287
|
+
const ptr = this.__destroy_into_raw();
|
288
|
+
wasm.__wbg_hash_free(ptr);
|
289
|
+
}
|
290
|
+
/**
|
291
|
+
* Create a new Hash object
|
292
|
+
*
|
293
|
+
* * `value` - optional hash as a base58 encoded string, `Uint8Array`, `[number]`
|
294
|
+
* @param {any} value
|
295
|
+
*/
|
296
|
+
constructor(value) {
|
297
|
+
try {
|
298
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
299
|
+
wasm.hash_constructor(retptr, addHeapObject(value));
|
300
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
301
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
302
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
303
|
+
if (r2) {
|
304
|
+
throw takeObject(r1);
|
305
|
+
}
|
306
|
+
return Hash.__wrap(r0);
|
307
|
+
} finally {
|
308
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
309
|
+
}
|
310
|
+
}
|
311
|
+
/**
|
312
|
+
* Return the base58 string representation of the hash
|
313
|
+
* @returns {string}
|
314
|
+
*/
|
315
|
+
toString() {
|
316
|
+
let deferred1_0;
|
317
|
+
let deferred1_1;
|
318
|
+
try {
|
319
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
320
|
+
wasm.hash_toString(retptr, this.__wbg_ptr);
|
321
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
322
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
323
|
+
deferred1_0 = r0;
|
324
|
+
deferred1_1 = r1;
|
325
|
+
return getStringFromWasm0(r0, r1);
|
326
|
+
} finally {
|
327
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
328
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
329
|
+
}
|
330
|
+
}
|
331
|
+
/**
|
332
|
+
* Checks if two `Hash`s are equal
|
333
|
+
* @param {Hash} other
|
334
|
+
* @returns {boolean}
|
335
|
+
*/
|
336
|
+
equals(other) {
|
337
|
+
_assertClass(other, Hash);
|
338
|
+
const ret = wasm.hash_equals(this.__wbg_ptr, other.__wbg_ptr);
|
339
|
+
return ret !== 0;
|
340
|
+
}
|
341
|
+
/**
|
342
|
+
* Return the `Uint8Array` representation of the hash
|
343
|
+
* @returns {Uint8Array}
|
344
|
+
*/
|
345
|
+
toBytes() {
|
346
|
+
try {
|
347
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
348
|
+
wasm.hash_toBytes(retptr, this.__wbg_ptr);
|
349
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
350
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
351
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
352
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
353
|
+
return v1;
|
354
|
+
} finally {
|
355
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
356
|
+
}
|
357
|
+
}
|
358
|
+
}
|
359
|
+
module.exports.Hash = Hash;
|
360
|
+
/**
|
361
|
+
* A directive for a single invocation of a Solana program.
|
362
|
+
*
|
363
|
+
* An instruction specifies which program it is calling, which accounts it may
|
364
|
+
* read or modify, and additional data that serves as input to the program. One
|
365
|
+
* or more instructions are included in transactions submitted by Solana
|
366
|
+
* clients. Instructions are also used to describe [cross-program
|
367
|
+
* invocations][cpi].
|
368
|
+
*
|
369
|
+
* [cpi]: https://docs.solana.com/developing/programming-model/calling-between-programs
|
370
|
+
*
|
371
|
+
* During execution, a program will receive a list of account data as one of
|
372
|
+
* its arguments, in the same order as specified during `Instruction`
|
373
|
+
* construction.
|
374
|
+
*
|
375
|
+
* While Solana is agnostic to the format of the instruction data, it has
|
376
|
+
* built-in support for serialization via [`borsh`] and [`bincode`].
|
377
|
+
*
|
378
|
+
* [`borsh`]: https://docs.rs/borsh/latest/borsh/
|
379
|
+
* [`bincode`]: https://docs.rs/bincode/latest/bincode/
|
380
|
+
*
|
381
|
+
* # Specifying account metadata
|
382
|
+
*
|
383
|
+
* When constructing an [`Instruction`], a list of all accounts that may be
|
384
|
+
* read or written during the execution of that instruction must be supplied as
|
385
|
+
* [`AccountMeta`] values.
|
386
|
+
*
|
387
|
+
* Any account whose data may be mutated by the program during execution must
|
388
|
+
* be specified as writable. During execution, writing to an account that was
|
389
|
+
* not specified as writable will cause the transaction to fail. Writing to an
|
390
|
+
* account that is not owned by the program will cause the transaction to fail.
|
391
|
+
*
|
392
|
+
* Any account whose lamport balance may be mutated by the program during
|
393
|
+
* execution must be specified as writable. During execution, mutating the
|
394
|
+
* lamports of an account that was not specified as writable will cause the
|
395
|
+
* transaction to fail. While _subtracting_ lamports from an account not owned
|
396
|
+
* by the program will cause the transaction to fail, _adding_ lamports to any
|
397
|
+
* account is allowed, as long is it is mutable.
|
398
|
+
*
|
399
|
+
* Accounts that are not read or written by the program may still be specified
|
400
|
+
* in an `Instruction`'s account list. These will affect scheduling of program
|
401
|
+
* execution by the runtime, but will otherwise be ignored.
|
402
|
+
*
|
403
|
+
* When building a transaction, the Solana runtime coalesces all accounts used
|
404
|
+
* by all instructions in that transaction, along with accounts and permissions
|
405
|
+
* required by the runtime, into a single account list. Some accounts and
|
406
|
+
* account permissions required by the runtime to process a transaction are
|
407
|
+
* _not_ required to be included in an `Instruction`s account list. These
|
408
|
+
* include:
|
409
|
+
*
|
410
|
+
* - The program ID — it is a separate field of `Instruction`
|
411
|
+
* - The transaction's fee-paying account — it is added during [`Message`]
|
412
|
+
* construction. A program may still require the fee payer as part of the
|
413
|
+
* account list if it directly references it.
|
414
|
+
*
|
415
|
+
* [`Message`]: crate::message::Message
|
416
|
+
*
|
417
|
+
* Programs may require signatures from some accounts, in which case they
|
418
|
+
* should be specified as signers during `Instruction` construction. The
|
419
|
+
* program must still validate during execution that the account is a signer.
|
420
|
+
*/
|
421
|
+
class Instruction {
|
422
|
+
|
423
|
+
static __wrap(ptr) {
|
424
|
+
ptr = ptr >>> 0;
|
425
|
+
const obj = Object.create(Instruction.prototype);
|
426
|
+
obj.__wbg_ptr = ptr;
|
427
|
+
|
428
|
+
return obj;
|
429
|
+
}
|
430
|
+
|
431
|
+
__destroy_into_raw() {
|
432
|
+
const ptr = this.__wbg_ptr;
|
433
|
+
this.__wbg_ptr = 0;
|
434
|
+
|
435
|
+
return ptr;
|
436
|
+
}
|
437
|
+
|
438
|
+
free() {
|
439
|
+
const ptr = this.__destroy_into_raw();
|
440
|
+
wasm.__wbg_instruction_free(ptr);
|
441
|
+
}
|
442
|
+
}
|
443
|
+
module.exports.Instruction = Instruction;
|
444
|
+
/**
|
445
|
+
*/
|
446
|
+
class Instructions {
|
447
|
+
|
448
|
+
static __wrap(ptr) {
|
449
|
+
ptr = ptr >>> 0;
|
450
|
+
const obj = Object.create(Instructions.prototype);
|
451
|
+
obj.__wbg_ptr = ptr;
|
452
|
+
|
453
|
+
return obj;
|
454
|
+
}
|
455
|
+
|
456
|
+
__destroy_into_raw() {
|
457
|
+
const ptr = this.__wbg_ptr;
|
458
|
+
this.__wbg_ptr = 0;
|
459
|
+
|
460
|
+
return ptr;
|
461
|
+
}
|
462
|
+
|
463
|
+
free() {
|
464
|
+
const ptr = this.__destroy_into_raw();
|
465
|
+
wasm.__wbg_instructions_free(ptr);
|
466
|
+
}
|
467
|
+
/**
|
468
|
+
*/
|
469
|
+
constructor() {
|
470
|
+
const ret = wasm.instructions_constructor();
|
471
|
+
return Instructions.__wrap(ret);
|
472
|
+
}
|
473
|
+
/**
|
474
|
+
* @param {Instruction} instruction
|
475
|
+
*/
|
476
|
+
push(instruction) {
|
477
|
+
_assertClass(instruction, Instruction);
|
478
|
+
var ptr0 = instruction.__destroy_into_raw();
|
479
|
+
wasm.instructions_push(this.__wbg_ptr, ptr0);
|
480
|
+
}
|
481
|
+
}
|
482
|
+
module.exports.Instructions = Instructions;
|
483
|
+
/**
|
484
|
+
* A Solana transaction message (legacy).
|
485
|
+
*
|
486
|
+
* See the [`message`] module documentation for further description.
|
487
|
+
*
|
488
|
+
* [`message`]: crate::message
|
489
|
+
*
|
490
|
+
* Some constructors accept an optional `payer`, the account responsible for
|
491
|
+
* paying the cost of executing a transaction. In most cases, callers should
|
492
|
+
* specify the payer explicitly in these constructors. In some cases though,
|
493
|
+
* the caller is not _required_ to specify the payer, but is still allowed to:
|
494
|
+
* in the `Message` structure, the first account is always the fee-payer, so if
|
495
|
+
* the caller has knowledge that the first account of the constructed
|
496
|
+
* transaction's `Message` is both a signer and the expected fee-payer, then
|
497
|
+
* redundantly specifying the fee-payer is not strictly required.
|
498
|
+
*/
|
499
|
+
class Message {
|
500
|
+
|
501
|
+
__destroy_into_raw() {
|
502
|
+
const ptr = this.__wbg_ptr;
|
503
|
+
this.__wbg_ptr = 0;
|
504
|
+
|
505
|
+
return ptr;
|
506
|
+
}
|
507
|
+
|
508
|
+
free() {
|
509
|
+
const ptr = this.__destroy_into_raw();
|
510
|
+
wasm.__wbg_message_free(ptr);
|
511
|
+
}
|
512
|
+
/**
|
513
|
+
* The id of a recent ledger entry.
|
514
|
+
* @returns {Hash}
|
515
|
+
*/
|
516
|
+
get recent_blockhash() {
|
517
|
+
const ret = wasm.__wbg_get_message_recent_blockhash(this.__wbg_ptr);
|
518
|
+
return Hash.__wrap(ret);
|
519
|
+
}
|
520
|
+
/**
|
521
|
+
* The id of a recent ledger entry.
|
522
|
+
* @param {Hash} arg0
|
523
|
+
*/
|
524
|
+
set recent_blockhash(arg0) {
|
525
|
+
_assertClass(arg0, Hash);
|
526
|
+
var ptr0 = arg0.__destroy_into_raw();
|
527
|
+
wasm.__wbg_set_message_recent_blockhash(this.__wbg_ptr, ptr0);
|
528
|
+
}
|
529
|
+
}
|
530
|
+
module.exports.Message = Message;
|
531
|
+
/**
|
532
|
+
* The address of a [Solana account][acc].
|
533
|
+
*
|
534
|
+
* Some account addresses are [ed25519] public keys, with corresponding secret
|
535
|
+
* keys that are managed off-chain. Often, though, account addresses do not
|
536
|
+
* have corresponding secret keys — as with [_program derived
|
537
|
+
* addresses_][pdas] — or the secret key is not relevant to the operation
|
538
|
+
* of a program, and may have even been disposed of. As running Solana programs
|
539
|
+
* can not safely create or manage secret keys, the full [`Keypair`] is not
|
540
|
+
* defined in `solana-program` but in `solana-sdk`.
|
541
|
+
*
|
542
|
+
* [acc]: https://docs.solana.com/developing/programming-model/accounts
|
543
|
+
* [ed25519]: https://ed25519.cr.yp.to/
|
544
|
+
* [pdas]: https://docs.solana.com/developing/programming-model/calling-between-programs#program-derived-addresses
|
545
|
+
* [`Keypair`]: https://docs.rs/solana-sdk/latest/solana_sdk/signer/keypair/struct.Keypair.html
|
546
|
+
*/
|
547
|
+
class Pubkey {
|
548
|
+
|
549
|
+
static __wrap(ptr) {
|
550
|
+
ptr = ptr >>> 0;
|
551
|
+
const obj = Object.create(Pubkey.prototype);
|
552
|
+
obj.__wbg_ptr = ptr;
|
553
|
+
|
554
|
+
return obj;
|
555
|
+
}
|
556
|
+
|
557
|
+
__destroy_into_raw() {
|
558
|
+
const ptr = this.__wbg_ptr;
|
559
|
+
this.__wbg_ptr = 0;
|
560
|
+
|
561
|
+
return ptr;
|
562
|
+
}
|
563
|
+
|
564
|
+
free() {
|
565
|
+
const ptr = this.__destroy_into_raw();
|
566
|
+
wasm.__wbg_pubkey_free(ptr);
|
567
|
+
}
|
568
|
+
/**
|
569
|
+
* Create a new Pubkey object
|
570
|
+
*
|
571
|
+
* * `value` - optional public key as a base58 encoded string, `Uint8Array`, `[number]`
|
572
|
+
* @param {any} value
|
573
|
+
*/
|
574
|
+
constructor(value) {
|
575
|
+
try {
|
576
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
577
|
+
wasm.pubkey_constructor(retptr, addHeapObject(value));
|
578
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
579
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
580
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
581
|
+
if (r2) {
|
582
|
+
throw takeObject(r1);
|
583
|
+
}
|
584
|
+
return Pubkey.__wrap(r0);
|
585
|
+
} finally {
|
586
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
587
|
+
}
|
588
|
+
}
|
589
|
+
/**
|
590
|
+
* Return the base58 string representation of the public key
|
591
|
+
* @returns {string}
|
592
|
+
*/
|
593
|
+
toString() {
|
594
|
+
let deferred1_0;
|
595
|
+
let deferred1_1;
|
596
|
+
try {
|
597
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
598
|
+
wasm.pubkey_toString(retptr, this.__wbg_ptr);
|
599
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
600
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
601
|
+
deferred1_0 = r0;
|
602
|
+
deferred1_1 = r1;
|
603
|
+
return getStringFromWasm0(r0, r1);
|
604
|
+
} finally {
|
605
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
606
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
607
|
+
}
|
608
|
+
}
|
609
|
+
/**
|
610
|
+
* Check if a `Pubkey` is on the ed25519 curve.
|
611
|
+
* @returns {boolean}
|
612
|
+
*/
|
613
|
+
isOnCurve() {
|
614
|
+
const ret = wasm.pubkey_isOnCurve(this.__wbg_ptr);
|
615
|
+
return ret !== 0;
|
616
|
+
}
|
617
|
+
/**
|
618
|
+
* Checks if two `Pubkey`s are equal
|
619
|
+
* @param {Pubkey} other
|
620
|
+
* @returns {boolean}
|
621
|
+
*/
|
622
|
+
equals(other) {
|
623
|
+
_assertClass(other, Pubkey);
|
624
|
+
const ret = wasm.pubkey_equals(this.__wbg_ptr, other.__wbg_ptr);
|
625
|
+
return ret !== 0;
|
626
|
+
}
|
627
|
+
/**
|
628
|
+
* Return the `Uint8Array` representation of the public key
|
629
|
+
* @returns {Uint8Array}
|
630
|
+
*/
|
631
|
+
toBytes() {
|
632
|
+
try {
|
633
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
634
|
+
wasm.pubkey_toBytes(retptr, this.__wbg_ptr);
|
635
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
636
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
637
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
638
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
639
|
+
return v1;
|
640
|
+
} finally {
|
641
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
642
|
+
}
|
643
|
+
}
|
644
|
+
/**
|
645
|
+
* Derive a Pubkey from another Pubkey, string seed, and a program id
|
646
|
+
* @param {Pubkey} base
|
647
|
+
* @param {string} seed
|
648
|
+
* @param {Pubkey} owner
|
649
|
+
* @returns {Pubkey}
|
650
|
+
*/
|
651
|
+
static createWithSeed(base, seed, owner) {
|
652
|
+
try {
|
653
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
654
|
+
_assertClass(base, Pubkey);
|
655
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
656
|
+
const len0 = WASM_VECTOR_LEN;
|
657
|
+
_assertClass(owner, Pubkey);
|
658
|
+
wasm.pubkey_createWithSeed(retptr, base.__wbg_ptr, ptr0, len0, owner.__wbg_ptr);
|
659
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
660
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
661
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
662
|
+
if (r2) {
|
663
|
+
throw takeObject(r1);
|
664
|
+
}
|
665
|
+
return Pubkey.__wrap(r0);
|
666
|
+
} finally {
|
667
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
668
|
+
}
|
669
|
+
}
|
670
|
+
/**
|
671
|
+
* Derive a program address from seeds and a program id
|
672
|
+
* @param {any[]} seeds
|
673
|
+
* @param {Pubkey} program_id
|
674
|
+
* @returns {Pubkey}
|
675
|
+
*/
|
676
|
+
static createProgramAddress(seeds, program_id) {
|
677
|
+
try {
|
678
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
679
|
+
const ptr0 = passArrayJsValueToWasm0(seeds, wasm.__wbindgen_malloc);
|
680
|
+
const len0 = WASM_VECTOR_LEN;
|
681
|
+
_assertClass(program_id, Pubkey);
|
682
|
+
wasm.pubkey_createProgramAddress(retptr, ptr0, len0, program_id.__wbg_ptr);
|
683
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
684
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
685
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
686
|
+
if (r2) {
|
687
|
+
throw takeObject(r1);
|
688
|
+
}
|
689
|
+
return Pubkey.__wrap(r0);
|
690
|
+
} finally {
|
691
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
692
|
+
}
|
693
|
+
}
|
694
|
+
/**
|
695
|
+
* Find a valid program address
|
696
|
+
*
|
697
|
+
* Returns:
|
698
|
+
* * `[PubKey, number]` - the program address and bump seed
|
699
|
+
* @param {any[]} seeds
|
700
|
+
* @param {Pubkey} program_id
|
701
|
+
* @returns {any}
|
702
|
+
*/
|
703
|
+
static findProgramAddress(seeds, program_id) {
|
704
|
+
try {
|
705
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
706
|
+
const ptr0 = passArrayJsValueToWasm0(seeds, wasm.__wbindgen_malloc);
|
707
|
+
const len0 = WASM_VECTOR_LEN;
|
708
|
+
_assertClass(program_id, Pubkey);
|
709
|
+
wasm.pubkey_findProgramAddress(retptr, ptr0, len0, program_id.__wbg_ptr);
|
710
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
711
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
712
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
713
|
+
if (r2) {
|
714
|
+
throw takeObject(r1);
|
715
|
+
}
|
716
|
+
return takeObject(r0);
|
717
|
+
} finally {
|
718
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
719
|
+
}
|
720
|
+
}
|
721
|
+
}
|
722
|
+
module.exports.Pubkey = Pubkey;
|
723
|
+
|
724
|
+
class SystemInstruction {
|
725
|
+
|
726
|
+
__destroy_into_raw() {
|
727
|
+
const ptr = this.__wbg_ptr;
|
728
|
+
this.__wbg_ptr = 0;
|
729
|
+
|
730
|
+
return ptr;
|
731
|
+
}
|
732
|
+
|
733
|
+
free() {
|
734
|
+
const ptr = this.__destroy_into_raw();
|
735
|
+
wasm.__wbg_systeminstruction_free(ptr);
|
736
|
+
}
|
737
|
+
/**
|
738
|
+
* @param {Pubkey} from_pubkey
|
739
|
+
* @param {Pubkey} to_pubkey
|
740
|
+
* @param {bigint} lamports
|
741
|
+
* @param {bigint} space
|
742
|
+
* @param {Pubkey} owner
|
743
|
+
* @returns {Instruction}
|
744
|
+
*/
|
745
|
+
static createAccount(from_pubkey, to_pubkey, lamports, space, owner) {
|
746
|
+
_assertClass(from_pubkey, Pubkey);
|
747
|
+
_assertClass(to_pubkey, Pubkey);
|
748
|
+
_assertClass(owner, Pubkey);
|
749
|
+
const ret = wasm.systeminstruction_createAccount(from_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, lamports, space, owner.__wbg_ptr);
|
750
|
+
return Instruction.__wrap(ret);
|
751
|
+
}
|
752
|
+
/**
|
753
|
+
* @param {Pubkey} from_pubkey
|
754
|
+
* @param {Pubkey} to_pubkey
|
755
|
+
* @param {Pubkey} base
|
756
|
+
* @param {string} seed
|
757
|
+
* @param {bigint} lamports
|
758
|
+
* @param {bigint} space
|
759
|
+
* @param {Pubkey} owner
|
760
|
+
* @returns {Instruction}
|
761
|
+
*/
|
762
|
+
static createAccountWithSeed(from_pubkey, to_pubkey, base, seed, lamports, space, owner) {
|
763
|
+
_assertClass(from_pubkey, Pubkey);
|
764
|
+
_assertClass(to_pubkey, Pubkey);
|
765
|
+
_assertClass(base, Pubkey);
|
766
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
767
|
+
const len0 = WASM_VECTOR_LEN;
|
768
|
+
_assertClass(owner, Pubkey);
|
769
|
+
const ret = wasm.systeminstruction_createAccountWithSeed(from_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, base.__wbg_ptr, ptr0, len0, lamports, space, owner.__wbg_ptr);
|
770
|
+
return Instruction.__wrap(ret);
|
771
|
+
}
|
772
|
+
/**
|
773
|
+
* @param {Pubkey} pubkey
|
774
|
+
* @param {Pubkey} owner
|
775
|
+
* @returns {Instruction}
|
776
|
+
*/
|
777
|
+
static assign(pubkey, owner) {
|
778
|
+
_assertClass(pubkey, Pubkey);
|
779
|
+
_assertClass(owner, Pubkey);
|
780
|
+
const ret = wasm.systeminstruction_assign(pubkey.__wbg_ptr, owner.__wbg_ptr);
|
781
|
+
return Instruction.__wrap(ret);
|
782
|
+
}
|
783
|
+
/**
|
784
|
+
* @param {Pubkey} pubkey
|
785
|
+
* @param {Pubkey} base
|
786
|
+
* @param {string} seed
|
787
|
+
* @param {Pubkey} owner
|
788
|
+
* @returns {Instruction}
|
789
|
+
*/
|
790
|
+
static assignWithSeed(pubkey, base, seed, owner) {
|
791
|
+
_assertClass(pubkey, Pubkey);
|
792
|
+
_assertClass(base, Pubkey);
|
793
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
794
|
+
const len0 = WASM_VECTOR_LEN;
|
795
|
+
_assertClass(owner, Pubkey);
|
796
|
+
const ret = wasm.systeminstruction_assignWithSeed(pubkey.__wbg_ptr, base.__wbg_ptr, ptr0, len0, owner.__wbg_ptr);
|
797
|
+
return Instruction.__wrap(ret);
|
798
|
+
}
|
799
|
+
/**
|
800
|
+
* @param {Pubkey} from_pubkey
|
801
|
+
* @param {Pubkey} to_pubkey
|
802
|
+
* @param {bigint} lamports
|
803
|
+
* @returns {Instruction}
|
804
|
+
*/
|
805
|
+
static transfer(from_pubkey, to_pubkey, lamports) {
|
806
|
+
_assertClass(from_pubkey, Pubkey);
|
807
|
+
_assertClass(to_pubkey, Pubkey);
|
808
|
+
const ret = wasm.systeminstruction_transfer(from_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, lamports);
|
809
|
+
return Instruction.__wrap(ret);
|
810
|
+
}
|
811
|
+
/**
|
812
|
+
* @param {Pubkey} from_pubkey
|
813
|
+
* @param {Pubkey} from_base
|
814
|
+
* @param {string} from_seed
|
815
|
+
* @param {Pubkey} from_owner
|
816
|
+
* @param {Pubkey} to_pubkey
|
817
|
+
* @param {bigint} lamports
|
818
|
+
* @returns {Instruction}
|
819
|
+
*/
|
820
|
+
static transferWithSeed(from_pubkey, from_base, from_seed, from_owner, to_pubkey, lamports) {
|
821
|
+
_assertClass(from_pubkey, Pubkey);
|
822
|
+
_assertClass(from_base, Pubkey);
|
823
|
+
const ptr0 = passStringToWasm0(from_seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
824
|
+
const len0 = WASM_VECTOR_LEN;
|
825
|
+
_assertClass(from_owner, Pubkey);
|
826
|
+
_assertClass(to_pubkey, Pubkey);
|
827
|
+
const ret = wasm.systeminstruction_transferWithSeed(from_pubkey.__wbg_ptr, from_base.__wbg_ptr, ptr0, len0, from_owner.__wbg_ptr, to_pubkey.__wbg_ptr, lamports);
|
828
|
+
return Instruction.__wrap(ret);
|
829
|
+
}
|
830
|
+
/**
|
831
|
+
* @param {Pubkey} pubkey
|
832
|
+
* @param {bigint} space
|
833
|
+
* @returns {Instruction}
|
834
|
+
*/
|
835
|
+
static allocate(pubkey, space) {
|
836
|
+
_assertClass(pubkey, Pubkey);
|
837
|
+
const ret = wasm.systeminstruction_allocate(pubkey.__wbg_ptr, space);
|
838
|
+
return Instruction.__wrap(ret);
|
839
|
+
}
|
840
|
+
/**
|
841
|
+
* @param {Pubkey} address
|
842
|
+
* @param {Pubkey} base
|
843
|
+
* @param {string} seed
|
844
|
+
* @param {bigint} space
|
845
|
+
* @param {Pubkey} owner
|
846
|
+
* @returns {Instruction}
|
847
|
+
*/
|
848
|
+
static allocateWithSeed(address, base, seed, space, owner) {
|
849
|
+
_assertClass(address, Pubkey);
|
850
|
+
_assertClass(base, Pubkey);
|
851
|
+
const ptr0 = passStringToWasm0(seed, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
852
|
+
const len0 = WASM_VECTOR_LEN;
|
853
|
+
_assertClass(owner, Pubkey);
|
854
|
+
const ret = wasm.systeminstruction_allocateWithSeed(address.__wbg_ptr, base.__wbg_ptr, ptr0, len0, space, owner.__wbg_ptr);
|
855
|
+
return Instruction.__wrap(ret);
|
856
|
+
}
|
857
|
+
/**
|
858
|
+
* @param {Pubkey} from_pubkey
|
859
|
+
* @param {Pubkey} nonce_pubkey
|
860
|
+
* @param {Pubkey} authority
|
861
|
+
* @param {bigint} lamports
|
862
|
+
* @returns {Array<any>}
|
863
|
+
*/
|
864
|
+
static createNonceAccount(from_pubkey, nonce_pubkey, authority, lamports) {
|
865
|
+
_assertClass(from_pubkey, Pubkey);
|
866
|
+
_assertClass(nonce_pubkey, Pubkey);
|
867
|
+
_assertClass(authority, Pubkey);
|
868
|
+
const ret = wasm.systeminstruction_createNonceAccount(from_pubkey.__wbg_ptr, nonce_pubkey.__wbg_ptr, authority.__wbg_ptr, lamports);
|
869
|
+
return takeObject(ret);
|
870
|
+
}
|
871
|
+
/**
|
872
|
+
* @param {Pubkey} nonce_pubkey
|
873
|
+
* @param {Pubkey} authorized_pubkey
|
874
|
+
* @returns {Instruction}
|
875
|
+
*/
|
876
|
+
static advanceNonceAccount(nonce_pubkey, authorized_pubkey) {
|
877
|
+
_assertClass(nonce_pubkey, Pubkey);
|
878
|
+
_assertClass(authorized_pubkey, Pubkey);
|
879
|
+
const ret = wasm.systeminstruction_advanceNonceAccount(nonce_pubkey.__wbg_ptr, authorized_pubkey.__wbg_ptr);
|
880
|
+
return Instruction.__wrap(ret);
|
881
|
+
}
|
882
|
+
/**
|
883
|
+
* @param {Pubkey} nonce_pubkey
|
884
|
+
* @param {Pubkey} authorized_pubkey
|
885
|
+
* @param {Pubkey} to_pubkey
|
886
|
+
* @param {bigint} lamports
|
887
|
+
* @returns {Instruction}
|
888
|
+
*/
|
889
|
+
static withdrawNonceAccount(nonce_pubkey, authorized_pubkey, to_pubkey, lamports) {
|
890
|
+
_assertClass(nonce_pubkey, Pubkey);
|
891
|
+
_assertClass(authorized_pubkey, Pubkey);
|
892
|
+
_assertClass(to_pubkey, Pubkey);
|
893
|
+
const ret = wasm.systeminstruction_withdrawNonceAccount(nonce_pubkey.__wbg_ptr, authorized_pubkey.__wbg_ptr, to_pubkey.__wbg_ptr, lamports);
|
894
|
+
return Instruction.__wrap(ret);
|
895
|
+
}
|
896
|
+
/**
|
897
|
+
* @param {Pubkey} nonce_pubkey
|
898
|
+
* @param {Pubkey} authorized_pubkey
|
899
|
+
* @param {Pubkey} new_authority
|
900
|
+
* @returns {Instruction}
|
901
|
+
*/
|
902
|
+
static authorizeNonceAccount(nonce_pubkey, authorized_pubkey, new_authority) {
|
903
|
+
_assertClass(nonce_pubkey, Pubkey);
|
904
|
+
_assertClass(authorized_pubkey, Pubkey);
|
905
|
+
_assertClass(new_authority, Pubkey);
|
906
|
+
const ret = wasm.systeminstruction_authorizeNonceAccount(nonce_pubkey.__wbg_ptr, authorized_pubkey.__wbg_ptr, new_authority.__wbg_ptr);
|
907
|
+
return Instruction.__wrap(ret);
|
908
|
+
}
|
909
|
+
}
|
910
|
+
module.exports.SystemInstruction = SystemInstruction;
|
911
|
+
|
912
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
913
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
914
|
+
return addHeapObject(ret);
|
915
|
+
};
|
916
|
+
|
917
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
918
|
+
takeObject(arg0);
|
919
|
+
};
|
920
|
+
|
921
|
+
module.exports.__wbg_log_fb911463b057a706 = function(arg0, arg1) {
|
922
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
923
|
+
};
|
924
|
+
|
925
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
926
|
+
const ret = arg0;
|
927
|
+
return addHeapObject(ret);
|
928
|
+
};
|
929
|
+
|
930
|
+
module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
|
931
|
+
const ret = BigInt.asUintN(64, arg0);
|
932
|
+
return addHeapObject(ret);
|
933
|
+
};
|
934
|
+
|
935
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
936
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
937
|
+
return addHeapObject(ret);
|
938
|
+
};
|
939
|
+
|
940
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
941
|
+
const ret = getObject(arg0);
|
942
|
+
return addHeapObject(ret);
|
943
|
+
};
|
944
|
+
|
945
|
+
module.exports.__wbindgen_is_object = function(arg0) {
|
946
|
+
const val = getObject(arg0);
|
947
|
+
const ret = typeof(val) === 'object' && val !== null;
|
948
|
+
return ret;
|
949
|
+
};
|
950
|
+
|
951
|
+
module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
952
|
+
const ret = getObject(arg0) == getObject(arg1);
|
953
|
+
return ret;
|
954
|
+
};
|
955
|
+
|
956
|
+
module.exports.__wbindgen_boolean_get = function(arg0) {
|
957
|
+
const v = getObject(arg0);
|
958
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
959
|
+
return ret;
|
960
|
+
};
|
961
|
+
|
962
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
963
|
+
const obj = getObject(arg1);
|
964
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
965
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
966
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
967
|
+
};
|
968
|
+
|
969
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
970
|
+
const obj = getObject(arg1);
|
971
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
972
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
973
|
+
var len1 = WASM_VECTOR_LEN;
|
974
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
975
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
976
|
+
};
|
977
|
+
|
978
|
+
module.exports.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
|
979
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
980
|
+
};
|
981
|
+
|
982
|
+
module.exports.__wbg_instruction_new = function(arg0) {
|
983
|
+
const ret = Instruction.__wrap(arg0);
|
984
|
+
return addHeapObject(ret);
|
985
|
+
};
|
986
|
+
|
987
|
+
module.exports.__wbg_pubkey_new = function(arg0) {
|
988
|
+
const ret = Pubkey.__wrap(arg0);
|
989
|
+
return addHeapObject(ret);
|
990
|
+
};
|
991
|
+
|
992
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
993
|
+
const ret = getObject(arg0) === undefined;
|
994
|
+
return ret;
|
995
|
+
};
|
996
|
+
|
997
|
+
module.exports.__wbg_debug_9a6b3243fbbebb61 = function(arg0) {
|
998
|
+
console.debug(getObject(arg0));
|
999
|
+
};
|
1000
|
+
|
1001
|
+
module.exports.__wbg_error_788ae33f81d3b84b = function(arg0) {
|
1002
|
+
console.error(getObject(arg0));
|
1003
|
+
};
|
1004
|
+
|
1005
|
+
module.exports.__wbg_info_2e30e8204b29d91d = function(arg0) {
|
1006
|
+
console.info(getObject(arg0));
|
1007
|
+
};
|
1008
|
+
|
1009
|
+
module.exports.__wbg_log_1d3ae0273d8f4f8a = function(arg0) {
|
1010
|
+
console.log(getObject(arg0));
|
1011
|
+
};
|
1012
|
+
|
1013
|
+
module.exports.__wbg_warn_d60e832f9882c1b2 = function(arg0) {
|
1014
|
+
console.warn(getObject(arg0));
|
1015
|
+
};
|
1016
|
+
|
1017
|
+
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
1018
|
+
const ret = new Error();
|
1019
|
+
return addHeapObject(ret);
|
1020
|
+
};
|
1021
|
+
|
1022
|
+
module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
1023
|
+
const ret = getObject(arg1).stack;
|
1024
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
1025
|
+
const len1 = WASM_VECTOR_LEN;
|
1026
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
1027
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
1028
|
+
};
|
1029
|
+
|
1030
|
+
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
1031
|
+
let deferred0_0;
|
1032
|
+
let deferred0_1;
|
1033
|
+
try {
|
1034
|
+
deferred0_0 = arg0;
|
1035
|
+
deferred0_1 = arg1;
|
1036
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
1037
|
+
} finally {
|
1038
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
1039
|
+
}
|
1040
|
+
};
|
1041
|
+
|
1042
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
1043
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
1044
|
+
return ret;
|
1045
|
+
};
|
1046
|
+
|
1047
|
+
module.exports.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
|
1048
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
1049
|
+
return addHeapObject(ret);
|
1050
|
+
};
|
1051
|
+
|
1052
|
+
module.exports.__wbg_length_fff51ee6522a1a18 = function(arg0) {
|
1053
|
+
const ret = getObject(arg0).length;
|
1054
|
+
return ret;
|
1055
|
+
};
|
1056
|
+
|
1057
|
+
module.exports.__wbg_new_898a68150f225f2e = function() {
|
1058
|
+
const ret = new Array();
|
1059
|
+
return addHeapObject(ret);
|
1060
|
+
};
|
1061
|
+
|
1062
|
+
module.exports.__wbindgen_is_function = function(arg0) {
|
1063
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
1064
|
+
return ret;
|
1065
|
+
};
|
1066
|
+
|
1067
|
+
module.exports.__wbg_new_56693dbed0c32988 = function() {
|
1068
|
+
const ret = new Map();
|
1069
|
+
return addHeapObject(ret);
|
1070
|
+
};
|
1071
|
+
|
1072
|
+
module.exports.__wbg_next_526fc47e980da008 = function(arg0) {
|
1073
|
+
const ret = getObject(arg0).next;
|
1074
|
+
return addHeapObject(ret);
|
1075
|
+
};
|
1076
|
+
|
1077
|
+
module.exports.__wbg_next_ddb3312ca1c4e32a = function() { return handleError(function (arg0) {
|
1078
|
+
const ret = getObject(arg0).next();
|
1079
|
+
return addHeapObject(ret);
|
1080
|
+
}, arguments) };
|
1081
|
+
|
1082
|
+
module.exports.__wbg_done_5c1f01fb660d73b5 = function(arg0) {
|
1083
|
+
const ret = getObject(arg0).done;
|
1084
|
+
return ret;
|
1085
|
+
};
|
1086
|
+
|
1087
|
+
module.exports.__wbg_value_1695675138684bd5 = function(arg0) {
|
1088
|
+
const ret = getObject(arg0).value;
|
1089
|
+
return addHeapObject(ret);
|
1090
|
+
};
|
1091
|
+
|
1092
|
+
module.exports.__wbg_iterator_97f0c81209c6c35a = function() {
|
1093
|
+
const ret = Symbol.iterator;
|
1094
|
+
return addHeapObject(ret);
|
1095
|
+
};
|
1096
|
+
|
1097
|
+
module.exports.__wbg_get_97b561fb56f034b5 = function() { return handleError(function (arg0, arg1) {
|
1098
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
1099
|
+
return addHeapObject(ret);
|
1100
|
+
}, arguments) };
|
1101
|
+
|
1102
|
+
module.exports.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
|
1103
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
1104
|
+
return addHeapObject(ret);
|
1105
|
+
}, arguments) };
|
1106
|
+
|
1107
|
+
module.exports.__wbg_new_b51585de1b234aff = function() {
|
1108
|
+
const ret = new Object();
|
1109
|
+
return addHeapObject(ret);
|
1110
|
+
};
|
1111
|
+
|
1112
|
+
module.exports.__wbg_newwithlength_3ec098a360da1909 = function(arg0) {
|
1113
|
+
const ret = new Array(arg0 >>> 0);
|
1114
|
+
return addHeapObject(ret);
|
1115
|
+
};
|
1116
|
+
|
1117
|
+
module.exports.__wbg_set_502d29070ea18557 = function(arg0, arg1, arg2) {
|
1118
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
1119
|
+
};
|
1120
|
+
|
1121
|
+
module.exports.__wbg_isArray_4c24b343cb13cfb1 = function(arg0) {
|
1122
|
+
const ret = Array.isArray(getObject(arg0));
|
1123
|
+
return ret;
|
1124
|
+
};
|
1125
|
+
|
1126
|
+
module.exports.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
|
1127
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
1128
|
+
return ret;
|
1129
|
+
};
|
1130
|
+
|
1131
|
+
module.exports.__wbg_instanceof_ArrayBuffer_39ac22089b74fddb = function(arg0) {
|
1132
|
+
let result;
|
1133
|
+
try {
|
1134
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
1135
|
+
} catch {
|
1136
|
+
result = false;
|
1137
|
+
}
|
1138
|
+
const ret = result;
|
1139
|
+
return ret;
|
1140
|
+
};
|
1141
|
+
|
1142
|
+
module.exports.__wbg_values_e80af618f92c8649 = function(arg0) {
|
1143
|
+
const ret = getObject(arg0).values();
|
1144
|
+
return addHeapObject(ret);
|
1145
|
+
};
|
1146
|
+
|
1147
|
+
module.exports.__wbg_set_bedc3d02d0f05eb0 = function(arg0, arg1, arg2) {
|
1148
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
1149
|
+
return addHeapObject(ret);
|
1150
|
+
};
|
1151
|
+
|
1152
|
+
module.exports.__wbg_isSafeInteger_bb8e18dd21c97288 = function(arg0) {
|
1153
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
1154
|
+
return ret;
|
1155
|
+
};
|
1156
|
+
|
1157
|
+
module.exports.__wbg_buffer_085ec1f694018c4f = function(arg0) {
|
1158
|
+
const ret = getObject(arg0).buffer;
|
1159
|
+
return addHeapObject(ret);
|
1160
|
+
};
|
1161
|
+
|
1162
|
+
module.exports.__wbg_new_8125e318e6245eed = function(arg0) {
|
1163
|
+
const ret = new Uint8Array(getObject(arg0));
|
1164
|
+
return addHeapObject(ret);
|
1165
|
+
};
|
1166
|
+
|
1167
|
+
module.exports.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
|
1168
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
1169
|
+
};
|
1170
|
+
|
1171
|
+
module.exports.__wbg_length_72e2208bbc0efc61 = function(arg0) {
|
1172
|
+
const ret = getObject(arg0).length;
|
1173
|
+
return ret;
|
1174
|
+
};
|
1175
|
+
|
1176
|
+
module.exports.__wbg_instanceof_Uint8Array_d8d9cb2b8e8ac1d4 = function(arg0) {
|
1177
|
+
let result;
|
1178
|
+
try {
|
1179
|
+
result = getObject(arg0) instanceof Uint8Array;
|
1180
|
+
} catch {
|
1181
|
+
result = false;
|
1182
|
+
}
|
1183
|
+
const ret = result;
|
1184
|
+
return ret;
|
1185
|
+
};
|
1186
|
+
|
1187
|
+
module.exports.__wbindgen_debug_string = function(arg0, arg1) {
|
1188
|
+
const ret = debugString(getObject(arg1));
|
1189
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
1190
|
+
const len1 = WASM_VECTOR_LEN;
|
1191
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
1192
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
1193
|
+
};
|
1194
|
+
|
1195
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
1196
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
1197
|
+
};
|
1198
|
+
|
1199
|
+
module.exports.__wbindgen_memory = function() {
|
1200
|
+
const ret = wasm.memory;
|
1201
|
+
return addHeapObject(ret);
|
1202
|
+
};
|
1203
|
+
|
1204
|
+
const path = require('path').join(__dirname, 'bincode_js_bg.wasm');
|
1205
|
+
const bytes = require('fs').readFileSync(path);
|
1206
|
+
|
1207
|
+
const wasmModule = new WebAssembly.Module(bytes);
|
1208
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
1209
|
+
wasm = wasmInstance.exports;
|
1210
|
+
module.exports.__wasm = wasm;
|
1211
|
+
|