@dashevo/wasm-sdk 2.1.0-dev.5
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 +241 -0
- package/dist/raw/wasm_sdk.d.ts +1110 -0
- package/dist/raw/wasm_sdk.js +4585 -0
- package/dist/raw/wasm_sdk.no_url.js +4585 -0
- package/dist/raw/wasm_sdk_bg.wasm +0 -0
- package/dist/raw/wasm_sdk_bg.wasm.d.ts +238 -0
- package/dist/sdk.d.ts +1110 -0
- package/dist/sdk.js +79 -0
- package/package.json +66 -0
|
@@ -0,0 +1,4585 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
let WASM_VECTOR_LEN = 0;
|
|
4
|
+
|
|
5
|
+
let cachedUint8ArrayMemory0 = null;
|
|
6
|
+
|
|
7
|
+
function getUint8ArrayMemory0() {
|
|
8
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return cachedUint8ArrayMemory0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
15
|
+
|
|
16
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
17
|
+
? function (arg, view) {
|
|
18
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
19
|
+
}
|
|
20
|
+
: function (arg, view) {
|
|
21
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
22
|
+
view.set(buf);
|
|
23
|
+
return {
|
|
24
|
+
read: arg.length,
|
|
25
|
+
written: buf.length
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
30
|
+
|
|
31
|
+
if (realloc === undefined) {
|
|
32
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
33
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
34
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
35
|
+
WASM_VECTOR_LEN = buf.length;
|
|
36
|
+
return ptr;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let len = arg.length;
|
|
40
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
41
|
+
|
|
42
|
+
const mem = getUint8ArrayMemory0();
|
|
43
|
+
|
|
44
|
+
let offset = 0;
|
|
45
|
+
|
|
46
|
+
for (; offset < len; offset++) {
|
|
47
|
+
const code = arg.charCodeAt(offset);
|
|
48
|
+
if (code > 0x7F) break;
|
|
49
|
+
mem[ptr + offset] = code;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (offset !== len) {
|
|
53
|
+
if (offset !== 0) {
|
|
54
|
+
arg = arg.slice(offset);
|
|
55
|
+
}
|
|
56
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
57
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
58
|
+
const ret = encodeString(arg, view);
|
|
59
|
+
|
|
60
|
+
offset += ret.written;
|
|
61
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
WASM_VECTOR_LEN = offset;
|
|
65
|
+
return ptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let cachedDataViewMemory0 = null;
|
|
69
|
+
|
|
70
|
+
function getDataViewMemory0() {
|
|
71
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
72
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
73
|
+
}
|
|
74
|
+
return cachedDataViewMemory0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
78
|
+
|
|
79
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
80
|
+
|
|
81
|
+
function getStringFromWasm0(ptr, len) {
|
|
82
|
+
ptr = ptr >>> 0;
|
|
83
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function addToExternrefTable0(obj) {
|
|
87
|
+
const idx = wasm.__externref_table_alloc();
|
|
88
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
89
|
+
return idx;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function handleError(f, args) {
|
|
93
|
+
try {
|
|
94
|
+
return f.apply(this, args);
|
|
95
|
+
} catch (e) {
|
|
96
|
+
const idx = addToExternrefTable0(e);
|
|
97
|
+
wasm.__wbindgen_exn_store(idx);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isLikeNone(x) {
|
|
102
|
+
return x === undefined || x === null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
106
|
+
? { register: () => {}, unregister: () => {} }
|
|
107
|
+
: new FinalizationRegistry(state => {
|
|
108
|
+
wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
112
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
113
|
+
const real = (...args) => {
|
|
114
|
+
// First up with a closure we increment the internal reference
|
|
115
|
+
// count. This ensures that the Rust closure environment won't
|
|
116
|
+
// be deallocated while we're invoking it.
|
|
117
|
+
state.cnt++;
|
|
118
|
+
const a = state.a;
|
|
119
|
+
state.a = 0;
|
|
120
|
+
try {
|
|
121
|
+
return f(a, state.b, ...args);
|
|
122
|
+
} finally {
|
|
123
|
+
if (--state.cnt === 0) {
|
|
124
|
+
wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
|
|
125
|
+
CLOSURE_DTORS.unregister(state);
|
|
126
|
+
} else {
|
|
127
|
+
state.a = a;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
real.original = state;
|
|
132
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
133
|
+
return real;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function debugString(val) {
|
|
137
|
+
// primitive types
|
|
138
|
+
const type = typeof val;
|
|
139
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
140
|
+
return `${val}`;
|
|
141
|
+
}
|
|
142
|
+
if (type == 'string') {
|
|
143
|
+
return `"${val}"`;
|
|
144
|
+
}
|
|
145
|
+
if (type == 'symbol') {
|
|
146
|
+
const description = val.description;
|
|
147
|
+
if (description == null) {
|
|
148
|
+
return 'Symbol';
|
|
149
|
+
} else {
|
|
150
|
+
return `Symbol(${description})`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (type == 'function') {
|
|
154
|
+
const name = val.name;
|
|
155
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
156
|
+
return `Function(${name})`;
|
|
157
|
+
} else {
|
|
158
|
+
return 'Function';
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// objects
|
|
162
|
+
if (Array.isArray(val)) {
|
|
163
|
+
const length = val.length;
|
|
164
|
+
let debug = '[';
|
|
165
|
+
if (length > 0) {
|
|
166
|
+
debug += debugString(val[0]);
|
|
167
|
+
}
|
|
168
|
+
for(let i = 1; i < length; i++) {
|
|
169
|
+
debug += ', ' + debugString(val[i]);
|
|
170
|
+
}
|
|
171
|
+
debug += ']';
|
|
172
|
+
return debug;
|
|
173
|
+
}
|
|
174
|
+
// Test for built-in
|
|
175
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
176
|
+
let className;
|
|
177
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
178
|
+
className = builtInMatches[1];
|
|
179
|
+
} else {
|
|
180
|
+
// Failed to match the standard '[object ClassName]'
|
|
181
|
+
return toString.call(val);
|
|
182
|
+
}
|
|
183
|
+
if (className == 'Object') {
|
|
184
|
+
// we're a user defined class or Object
|
|
185
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
186
|
+
// easier than looping through ownProperties of `val`.
|
|
187
|
+
try {
|
|
188
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
189
|
+
} catch (_) {
|
|
190
|
+
return 'Object';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// errors
|
|
194
|
+
if (val instanceof Error) {
|
|
195
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
196
|
+
}
|
|
197
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
198
|
+
return className;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* @returns {Promise<IdentityWasm | undefined>}
|
|
202
|
+
*/
|
|
203
|
+
export function verifyIdentityResponse() {
|
|
204
|
+
const ret = wasm.verifyIdentityResponse();
|
|
205
|
+
return ret;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @returns {Promise<DataContractWasm | undefined>}
|
|
210
|
+
*/
|
|
211
|
+
export function verifyDataContract() {
|
|
212
|
+
const ret = wasm.verifyDataContract();
|
|
213
|
+
return ret;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @returns {Promise<DocumentWasm[]>}
|
|
218
|
+
*/
|
|
219
|
+
export function verifyDocuments() {
|
|
220
|
+
const ret = wasm.verifyDocuments();
|
|
221
|
+
return ret;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
225
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
226
|
+
for (let i = 0; i < array.length; i++) {
|
|
227
|
+
const add = addToExternrefTable0(array[i]);
|
|
228
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
229
|
+
}
|
|
230
|
+
WASM_VECTOR_LEN = array.length;
|
|
231
|
+
return ptr;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
let cachedUint32ArrayMemory0 = null;
|
|
235
|
+
|
|
236
|
+
function getUint32ArrayMemory0() {
|
|
237
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
238
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
239
|
+
}
|
|
240
|
+
return cachedUint32ArrayMemory0;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function passArray32ToWasm0(arg, malloc) {
|
|
244
|
+
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
245
|
+
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
246
|
+
WASM_VECTOR_LEN = arg.length;
|
|
247
|
+
return ptr;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @returns {Promise<void>}
|
|
251
|
+
*/
|
|
252
|
+
export function start() {
|
|
253
|
+
wasm.start();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function takeFromExternrefTable0(idx) {
|
|
257
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
258
|
+
wasm.__externref_table_dealloc(idx);
|
|
259
|
+
return value;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
263
|
+
ptr = ptr >>> 0;
|
|
264
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
268
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
269
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
270
|
+
WASM_VECTOR_LEN = arg.length;
|
|
271
|
+
return ptr;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function _assertClass(instance, klass) {
|
|
275
|
+
if (!(instance instanceof klass)) {
|
|
276
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
281
|
+
ptr = ptr >>> 0;
|
|
282
|
+
const mem = getDataViewMemory0();
|
|
283
|
+
const result = [];
|
|
284
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
285
|
+
result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true)));
|
|
286
|
+
}
|
|
287
|
+
wasm.__externref_drop_slice(ptr, len);
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
290
|
+
function __wbg_adapter_56(arg0, arg1) {
|
|
291
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3c8cfe14db767e65(arg0, arg1);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function __wbg_adapter_59(arg0, arg1) {
|
|
295
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9abe8abae4d8f08e(arg0, arg1);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function __wbg_adapter_62(arg0, arg1) {
|
|
299
|
+
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h858a1e33a48810fa(arg0, arg1);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
function __wbg_adapter_65(arg0, arg1, arg2) {
|
|
303
|
+
wasm.closure5156_externref_shim(arg0, arg1, arg2);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function __wbg_adapter_470(arg0, arg1, arg2, arg3) {
|
|
307
|
+
wasm.closure6846_externref_shim(arg0, arg1, arg2, arg3);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Structured error surfaced to JS consumers
|
|
312
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23}
|
|
313
|
+
*/
|
|
314
|
+
export const WasmSdkErrorKind = Object.freeze({
|
|
315
|
+
Config: 0, "0": "Config",
|
|
316
|
+
Drive: 1, "1": "Drive",
|
|
317
|
+
DriveProofError: 2, "2": "DriveProofError",
|
|
318
|
+
Protocol: 3, "3": "Protocol",
|
|
319
|
+
Proof: 4, "4": "Proof",
|
|
320
|
+
InvalidProvedResponse: 5, "5": "InvalidProvedResponse",
|
|
321
|
+
DapiClientError: 6, "6": "DapiClientError",
|
|
322
|
+
DapiMocksError: 7, "7": "DapiMocksError",
|
|
323
|
+
CoreError: 8, "8": "CoreError",
|
|
324
|
+
MerkleBlockError: 9, "9": "MerkleBlockError",
|
|
325
|
+
CoreClientError: 10, "10": "CoreClientError",
|
|
326
|
+
MissingDependency: 11, "11": "MissingDependency",
|
|
327
|
+
TotalCreditsNotFound: 12, "12": "TotalCreditsNotFound",
|
|
328
|
+
EpochNotFound: 13, "13": "EpochNotFound",
|
|
329
|
+
TimeoutReached: 14, "14": "TimeoutReached",
|
|
330
|
+
AlreadyExists: 15, "15": "AlreadyExists",
|
|
331
|
+
Generic: 16, "16": "Generic",
|
|
332
|
+
ContextProviderError: 17, "17": "ContextProviderError",
|
|
333
|
+
Cancelled: 18, "18": "Cancelled",
|
|
334
|
+
StaleNode: 19, "19": "StaleNode",
|
|
335
|
+
StateTransitionBroadcastError: 20, "20": "StateTransitionBroadcastError",
|
|
336
|
+
InvalidArgument: 21, "21": "InvalidArgument",
|
|
337
|
+
SerializationError: 22, "22": "SerializationError",
|
|
338
|
+
NotFound: 23, "23": "NotFound",
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
const __wbindgen_enum_ReadableStreamType = ["bytes"];
|
|
342
|
+
|
|
343
|
+
const __wbindgen_enum_ReferrerPolicy = ["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url", "same-origin", "strict-origin", "strict-origin-when-cross-origin"];
|
|
344
|
+
|
|
345
|
+
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
346
|
+
|
|
347
|
+
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
348
|
+
|
|
349
|
+
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
350
|
+
|
|
351
|
+
const __wbindgen_enum_RequestRedirect = ["follow", "error", "manual"];
|
|
352
|
+
|
|
353
|
+
const DataContractWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
354
|
+
? { register: () => {}, unregister: () => {} }
|
|
355
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_datacontractwasm_free(ptr >>> 0, 1));
|
|
356
|
+
|
|
357
|
+
export class DataContractWasm {
|
|
358
|
+
|
|
359
|
+
static __wrap(ptr) {
|
|
360
|
+
ptr = ptr >>> 0;
|
|
361
|
+
const obj = Object.create(DataContractWasm.prototype);
|
|
362
|
+
obj.__wbg_ptr = ptr;
|
|
363
|
+
DataContractWasmFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
364
|
+
return obj;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
__destroy_into_raw() {
|
|
368
|
+
const ptr = this.__wbg_ptr;
|
|
369
|
+
this.__wbg_ptr = 0;
|
|
370
|
+
DataContractWasmFinalization.unregister(this);
|
|
371
|
+
return ptr;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
free() {
|
|
375
|
+
const ptr = this.__destroy_into_raw();
|
|
376
|
+
wasm.__wbg_datacontractwasm_free(ptr, 0);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* @returns {string}
|
|
380
|
+
*/
|
|
381
|
+
id() {
|
|
382
|
+
let deferred1_0;
|
|
383
|
+
let deferred1_1;
|
|
384
|
+
try {
|
|
385
|
+
const ret = wasm.datacontractwasm_id(this.__wbg_ptr);
|
|
386
|
+
deferred1_0 = ret[0];
|
|
387
|
+
deferred1_1 = ret[1];
|
|
388
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
389
|
+
} finally {
|
|
390
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @returns {any}
|
|
395
|
+
*/
|
|
396
|
+
toJSON() {
|
|
397
|
+
const ret = wasm.datacontractwasm_toJSON(this.__wbg_ptr);
|
|
398
|
+
if (ret[2]) {
|
|
399
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
400
|
+
}
|
|
401
|
+
return takeFromExternrefTable0(ret[0]);
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
const DocumentWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
406
|
+
? { register: () => {}, unregister: () => {} }
|
|
407
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_documentwasm_free(ptr >>> 0, 1));
|
|
408
|
+
|
|
409
|
+
export class DocumentWasm {
|
|
410
|
+
|
|
411
|
+
static __wrap(ptr) {
|
|
412
|
+
ptr = ptr >>> 0;
|
|
413
|
+
const obj = Object.create(DocumentWasm.prototype);
|
|
414
|
+
obj.__wbg_ptr = ptr;
|
|
415
|
+
DocumentWasmFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
416
|
+
return obj;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
__destroy_into_raw() {
|
|
420
|
+
const ptr = this.__wbg_ptr;
|
|
421
|
+
this.__wbg_ptr = 0;
|
|
422
|
+
DocumentWasmFinalization.unregister(this);
|
|
423
|
+
return ptr;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
free() {
|
|
427
|
+
const ptr = this.__destroy_into_raw();
|
|
428
|
+
wasm.__wbg_documentwasm_free(ptr, 0);
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* @returns {string}
|
|
432
|
+
*/
|
|
433
|
+
id() {
|
|
434
|
+
let deferred1_0;
|
|
435
|
+
let deferred1_1;
|
|
436
|
+
try {
|
|
437
|
+
const ret = wasm.documentwasm_id(this.__wbg_ptr);
|
|
438
|
+
deferred1_0 = ret[0];
|
|
439
|
+
deferred1_1 = ret[1];
|
|
440
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
441
|
+
} finally {
|
|
442
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
const IdentityWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
448
|
+
? { register: () => {}, unregister: () => {} }
|
|
449
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_identitywasm_free(ptr >>> 0, 1));
|
|
450
|
+
|
|
451
|
+
export class IdentityWasm {
|
|
452
|
+
|
|
453
|
+
static __wrap(ptr) {
|
|
454
|
+
ptr = ptr >>> 0;
|
|
455
|
+
const obj = Object.create(IdentityWasm.prototype);
|
|
456
|
+
obj.__wbg_ptr = ptr;
|
|
457
|
+
IdentityWasmFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
458
|
+
return obj;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
__destroy_into_raw() {
|
|
462
|
+
const ptr = this.__wbg_ptr;
|
|
463
|
+
this.__wbg_ptr = 0;
|
|
464
|
+
IdentityWasmFinalization.unregister(this);
|
|
465
|
+
return ptr;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
free() {
|
|
469
|
+
const ptr = this.__destroy_into_raw();
|
|
470
|
+
wasm.__wbg_identitywasm_free(ptr, 0);
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* @param {number} platform_version
|
|
474
|
+
*/
|
|
475
|
+
constructor(platform_version) {
|
|
476
|
+
const ret = wasm.identitywasm_new(platform_version);
|
|
477
|
+
if (ret[2]) {
|
|
478
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
479
|
+
}
|
|
480
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
481
|
+
IdentityWasmFinalization.register(this, this.__wbg_ptr, this);
|
|
482
|
+
return this;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* @param {Array<any>} public_keys
|
|
486
|
+
* @returns {number}
|
|
487
|
+
*/
|
|
488
|
+
setPublicKeys(public_keys) {
|
|
489
|
+
const ret = wasm.identitywasm_setPublicKeys(this.__wbg_ptr, public_keys);
|
|
490
|
+
if (ret[2]) {
|
|
491
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
492
|
+
}
|
|
493
|
+
return ret[0] >>> 0;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* @returns {number}
|
|
497
|
+
*/
|
|
498
|
+
get balance() {
|
|
499
|
+
const ret = wasm.identitywasm_balance(this.__wbg_ptr);
|
|
500
|
+
return ret;
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* @returns {number}
|
|
504
|
+
*/
|
|
505
|
+
getBalance() {
|
|
506
|
+
const ret = wasm.identitywasm_balance(this.__wbg_ptr);
|
|
507
|
+
return ret;
|
|
508
|
+
}
|
|
509
|
+
/**
|
|
510
|
+
* @param {number} balance
|
|
511
|
+
*/
|
|
512
|
+
setBalance(balance) {
|
|
513
|
+
wasm.identitywasm_setBalance(this.__wbg_ptr, balance);
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* @param {number} amount
|
|
517
|
+
* @returns {number}
|
|
518
|
+
*/
|
|
519
|
+
increaseBalance(amount) {
|
|
520
|
+
const ret = wasm.identitywasm_increaseBalance(this.__wbg_ptr, amount);
|
|
521
|
+
return ret;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* @param {number} amount
|
|
525
|
+
* @returns {number}
|
|
526
|
+
*/
|
|
527
|
+
reduceBalance(amount) {
|
|
528
|
+
const ret = wasm.identitywasm_reduceBalance(this.__wbg_ptr, amount);
|
|
529
|
+
return ret;
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* @param {number} revision
|
|
533
|
+
*/
|
|
534
|
+
setRevision(revision) {
|
|
535
|
+
wasm.identitywasm_setRevision(this.__wbg_ptr, revision);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* @returns {number}
|
|
539
|
+
*/
|
|
540
|
+
getRevision() {
|
|
541
|
+
const ret = wasm.identitywasm_getRevision(this.__wbg_ptr);
|
|
542
|
+
return ret;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* @returns {any}
|
|
546
|
+
*/
|
|
547
|
+
toJSON() {
|
|
548
|
+
const ret = wasm.identitywasm_toJSON(this.__wbg_ptr);
|
|
549
|
+
if (ret[2]) {
|
|
550
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
551
|
+
}
|
|
552
|
+
return takeFromExternrefTable0(ret[0]);
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* @returns {Uint8Array}
|
|
556
|
+
*/
|
|
557
|
+
hash() {
|
|
558
|
+
const ret = wasm.identitywasm_hash(this.__wbg_ptr);
|
|
559
|
+
if (ret[3]) {
|
|
560
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
561
|
+
}
|
|
562
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
563
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
564
|
+
return v1;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* @returns {number}
|
|
568
|
+
*/
|
|
569
|
+
getPublicKeyMaxId() {
|
|
570
|
+
const ret = wasm.identitywasm_getPublicKeyMaxId(this.__wbg_ptr);
|
|
571
|
+
return ret;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* @param {Uint8Array} buffer
|
|
575
|
+
* @returns {IdentityWasm}
|
|
576
|
+
*/
|
|
577
|
+
static fromBuffer(buffer) {
|
|
578
|
+
const ptr0 = passArray8ToWasm0(buffer, wasm.__wbindgen_malloc);
|
|
579
|
+
const len0 = WASM_VECTOR_LEN;
|
|
580
|
+
const ret = wasm.identitywasm_fromBuffer(ptr0, len0);
|
|
581
|
+
if (ret[2]) {
|
|
582
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
583
|
+
}
|
|
584
|
+
return IdentityWasm.__wrap(ret[0]);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
const IntoUnderlyingByteSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
589
|
+
? { register: () => {}, unregister: () => {} }
|
|
590
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingbytesource_free(ptr >>> 0, 1));
|
|
591
|
+
|
|
592
|
+
export class IntoUnderlyingByteSource {
|
|
593
|
+
|
|
594
|
+
__destroy_into_raw() {
|
|
595
|
+
const ptr = this.__wbg_ptr;
|
|
596
|
+
this.__wbg_ptr = 0;
|
|
597
|
+
IntoUnderlyingByteSourceFinalization.unregister(this);
|
|
598
|
+
return ptr;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
free() {
|
|
602
|
+
const ptr = this.__destroy_into_raw();
|
|
603
|
+
wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* @returns {ReadableStreamType}
|
|
607
|
+
*/
|
|
608
|
+
get type() {
|
|
609
|
+
const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
|
|
610
|
+
return __wbindgen_enum_ReadableStreamType[ret];
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* @returns {number}
|
|
614
|
+
*/
|
|
615
|
+
get autoAllocateChunkSize() {
|
|
616
|
+
const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
|
|
617
|
+
return ret >>> 0;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* @param {ReadableByteStreamController} controller
|
|
621
|
+
*/
|
|
622
|
+
start(controller) {
|
|
623
|
+
wasm.intounderlyingbytesource_start(this.__wbg_ptr, controller);
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* @param {ReadableByteStreamController} controller
|
|
627
|
+
* @returns {Promise<any>}
|
|
628
|
+
*/
|
|
629
|
+
pull(controller) {
|
|
630
|
+
const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, controller);
|
|
631
|
+
return ret;
|
|
632
|
+
}
|
|
633
|
+
cancel() {
|
|
634
|
+
const ptr = this.__destroy_into_raw();
|
|
635
|
+
wasm.intounderlyingbytesource_cancel(ptr);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
const IntoUnderlyingSinkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
640
|
+
? { register: () => {}, unregister: () => {} }
|
|
641
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsink_free(ptr >>> 0, 1));
|
|
642
|
+
|
|
643
|
+
export class IntoUnderlyingSink {
|
|
644
|
+
|
|
645
|
+
__destroy_into_raw() {
|
|
646
|
+
const ptr = this.__wbg_ptr;
|
|
647
|
+
this.__wbg_ptr = 0;
|
|
648
|
+
IntoUnderlyingSinkFinalization.unregister(this);
|
|
649
|
+
return ptr;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
free() {
|
|
653
|
+
const ptr = this.__destroy_into_raw();
|
|
654
|
+
wasm.__wbg_intounderlyingsink_free(ptr, 0);
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* @param {any} chunk
|
|
658
|
+
* @returns {Promise<any>}
|
|
659
|
+
*/
|
|
660
|
+
write(chunk) {
|
|
661
|
+
const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, chunk);
|
|
662
|
+
return ret;
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* @returns {Promise<any>}
|
|
666
|
+
*/
|
|
667
|
+
close() {
|
|
668
|
+
const ptr = this.__destroy_into_raw();
|
|
669
|
+
const ret = wasm.intounderlyingsink_close(ptr);
|
|
670
|
+
return ret;
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* @param {any} reason
|
|
674
|
+
* @returns {Promise<any>}
|
|
675
|
+
*/
|
|
676
|
+
abort(reason) {
|
|
677
|
+
const ptr = this.__destroy_into_raw();
|
|
678
|
+
const ret = wasm.intounderlyingsink_abort(ptr, reason);
|
|
679
|
+
return ret;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
const IntoUnderlyingSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
684
|
+
? { register: () => {}, unregister: () => {} }
|
|
685
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_intounderlyingsource_free(ptr >>> 0, 1));
|
|
686
|
+
|
|
687
|
+
export class IntoUnderlyingSource {
|
|
688
|
+
|
|
689
|
+
__destroy_into_raw() {
|
|
690
|
+
const ptr = this.__wbg_ptr;
|
|
691
|
+
this.__wbg_ptr = 0;
|
|
692
|
+
IntoUnderlyingSourceFinalization.unregister(this);
|
|
693
|
+
return ptr;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
free() {
|
|
697
|
+
const ptr = this.__destroy_into_raw();
|
|
698
|
+
wasm.__wbg_intounderlyingsource_free(ptr, 0);
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* @param {ReadableStreamDefaultController} controller
|
|
702
|
+
* @returns {Promise<any>}
|
|
703
|
+
*/
|
|
704
|
+
pull(controller) {
|
|
705
|
+
const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, controller);
|
|
706
|
+
return ret;
|
|
707
|
+
}
|
|
708
|
+
cancel() {
|
|
709
|
+
const ptr = this.__destroy_into_raw();
|
|
710
|
+
wasm.intounderlyingsource_cancel(ptr);
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
const WasmContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
715
|
+
? { register: () => {}, unregister: () => {} }
|
|
716
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcontext_free(ptr >>> 0, 1));
|
|
717
|
+
|
|
718
|
+
export class WasmContext {
|
|
719
|
+
|
|
720
|
+
__destroy_into_raw() {
|
|
721
|
+
const ptr = this.__wbg_ptr;
|
|
722
|
+
this.__wbg_ptr = 0;
|
|
723
|
+
WasmContextFinalization.unregister(this);
|
|
724
|
+
return ptr;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
free() {
|
|
728
|
+
const ptr = this.__destroy_into_raw();
|
|
729
|
+
wasm.__wbg_wasmcontext_free(ptr, 0);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
const WasmSdkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
734
|
+
? { register: () => {}, unregister: () => {} }
|
|
735
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsdk_free(ptr >>> 0, 1));
|
|
736
|
+
|
|
737
|
+
export class WasmSdk {
|
|
738
|
+
|
|
739
|
+
static __wrap(ptr) {
|
|
740
|
+
ptr = ptr >>> 0;
|
|
741
|
+
const obj = Object.create(WasmSdk.prototype);
|
|
742
|
+
obj.__wbg_ptr = ptr;
|
|
743
|
+
WasmSdkFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
744
|
+
return obj;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
__destroy_into_raw() {
|
|
748
|
+
const ptr = this.__wbg_ptr;
|
|
749
|
+
this.__wbg_ptr = 0;
|
|
750
|
+
WasmSdkFinalization.unregister(this);
|
|
751
|
+
return ptr;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
free() {
|
|
755
|
+
const ptr = this.__destroy_into_raw();
|
|
756
|
+
wasm.__wbg_wasmsdk_free(ptr, 0);
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* @param {string} base58_id
|
|
760
|
+
* @returns {Promise<DataContractWasm>}
|
|
761
|
+
*/
|
|
762
|
+
getDataContract(base58_id) {
|
|
763
|
+
const ptr0 = passStringToWasm0(base58_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
764
|
+
const len0 = WASM_VECTOR_LEN;
|
|
765
|
+
const ret = wasm.wasmsdk_getDataContract(this.__wbg_ptr, ptr0, len0);
|
|
766
|
+
return ret;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* @param {string} base58_id
|
|
770
|
+
* @returns {Promise<any>}
|
|
771
|
+
*/
|
|
772
|
+
getDataContractWithProofInfo(base58_id) {
|
|
773
|
+
const ptr0 = passStringToWasm0(base58_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
774
|
+
const len0 = WASM_VECTOR_LEN;
|
|
775
|
+
const ret = wasm.wasmsdk_getDataContractWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
776
|
+
return ret;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* @param {string} id
|
|
780
|
+
* @param {number | null} [limit]
|
|
781
|
+
* @param {number | null} [_offset]
|
|
782
|
+
* @param {bigint | null} [start_at_ms]
|
|
783
|
+
* @returns {Promise<any>}
|
|
784
|
+
*/
|
|
785
|
+
getDataContractHistory(id, limit, _offset, start_at_ms) {
|
|
786
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
787
|
+
const len0 = WASM_VECTOR_LEN;
|
|
788
|
+
const ret = wasm.wasmsdk_getDataContractHistory(this.__wbg_ptr, ptr0, len0, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(_offset) ? 0x100000001 : (_offset) >>> 0, !isLikeNone(start_at_ms), isLikeNone(start_at_ms) ? BigInt(0) : start_at_ms);
|
|
789
|
+
return ret;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* @param {string[]} ids
|
|
793
|
+
* @returns {Promise<any>}
|
|
794
|
+
*/
|
|
795
|
+
getDataContracts(ids) {
|
|
796
|
+
const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_malloc);
|
|
797
|
+
const len0 = WASM_VECTOR_LEN;
|
|
798
|
+
const ret = wasm.wasmsdk_getDataContracts(this.__wbg_ptr, ptr0, len0);
|
|
799
|
+
return ret;
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* @param {string} id
|
|
803
|
+
* @param {number | null} [limit]
|
|
804
|
+
* @param {number | null} [_offset]
|
|
805
|
+
* @param {bigint | null} [start_at_ms]
|
|
806
|
+
* @returns {Promise<any>}
|
|
807
|
+
*/
|
|
808
|
+
getDataContractHistoryWithProofInfo(id, limit, _offset, start_at_ms) {
|
|
809
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
810
|
+
const len0 = WASM_VECTOR_LEN;
|
|
811
|
+
const ret = wasm.wasmsdk_getDataContractHistoryWithProofInfo(this.__wbg_ptr, ptr0, len0, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(_offset) ? 0x100000001 : (_offset) >>> 0, !isLikeNone(start_at_ms), isLikeNone(start_at_ms) ? BigInt(0) : start_at_ms);
|
|
812
|
+
return ret;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* @param {string[]} ids
|
|
816
|
+
* @returns {Promise<any>}
|
|
817
|
+
*/
|
|
818
|
+
getDataContractsWithProofInfo(ids) {
|
|
819
|
+
const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_malloc);
|
|
820
|
+
const len0 = WASM_VECTOR_LEN;
|
|
821
|
+
const ret = wasm.wasmsdk_getDataContractsWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
822
|
+
return ret;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* @param {string} base58_id
|
|
826
|
+
* @returns {Promise<IdentityWasm>}
|
|
827
|
+
*/
|
|
828
|
+
getIdentity(base58_id) {
|
|
829
|
+
const ptr0 = passStringToWasm0(base58_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
830
|
+
const len0 = WASM_VECTOR_LEN;
|
|
831
|
+
const ret = wasm.wasmsdk_getIdentity(this.__wbg_ptr, ptr0, len0);
|
|
832
|
+
return ret;
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* @param {string} base58_id
|
|
836
|
+
* @returns {Promise<any>}
|
|
837
|
+
*/
|
|
838
|
+
getIdentityWithProofInfo(base58_id) {
|
|
839
|
+
const ptr0 = passStringToWasm0(base58_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
840
|
+
const len0 = WASM_VECTOR_LEN;
|
|
841
|
+
const ret = wasm.wasmsdk_getIdentityWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
842
|
+
return ret;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* @param {string} base58_id
|
|
846
|
+
* @returns {Promise<IdentityWasm>}
|
|
847
|
+
*/
|
|
848
|
+
getIdentityUnproved(base58_id) {
|
|
849
|
+
const ptr0 = passStringToWasm0(base58_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
850
|
+
const len0 = WASM_VECTOR_LEN;
|
|
851
|
+
const ret = wasm.wasmsdk_getIdentityUnproved(this.__wbg_ptr, ptr0, len0);
|
|
852
|
+
return ret;
|
|
853
|
+
}
|
|
854
|
+
/**
|
|
855
|
+
* @param {string} identity_id
|
|
856
|
+
* @param {string} key_request_type
|
|
857
|
+
* @param {Uint32Array | null} [specific_key_ids]
|
|
858
|
+
* @param {string | null} [search_purpose_map]
|
|
859
|
+
* @param {number | null} [limit]
|
|
860
|
+
* @param {number | null} [offset]
|
|
861
|
+
* @returns {Promise<any>}
|
|
862
|
+
*/
|
|
863
|
+
getIdentityKeys(identity_id, key_request_type, specific_key_ids, search_purpose_map, limit, offset) {
|
|
864
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
865
|
+
const len0 = WASM_VECTOR_LEN;
|
|
866
|
+
const ptr1 = passStringToWasm0(key_request_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
867
|
+
const len1 = WASM_VECTOR_LEN;
|
|
868
|
+
var ptr2 = isLikeNone(specific_key_ids) ? 0 : passArray32ToWasm0(specific_key_ids, wasm.__wbindgen_malloc);
|
|
869
|
+
var len2 = WASM_VECTOR_LEN;
|
|
870
|
+
var ptr3 = isLikeNone(search_purpose_map) ? 0 : passStringToWasm0(search_purpose_map, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
871
|
+
var len3 = WASM_VECTOR_LEN;
|
|
872
|
+
const ret = wasm.wasmsdk_getIdentityKeys(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(offset) ? 0x100000001 : (offset) >>> 0);
|
|
873
|
+
return ret;
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* @param {string} identity_id
|
|
877
|
+
* @returns {Promise<any>}
|
|
878
|
+
*/
|
|
879
|
+
getIdentityNonce(identity_id) {
|
|
880
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
881
|
+
const len0 = WASM_VECTOR_LEN;
|
|
882
|
+
const ret = wasm.wasmsdk_getIdentityNonce(this.__wbg_ptr, ptr0, len0);
|
|
883
|
+
return ret;
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* @param {string} identity_id
|
|
887
|
+
* @returns {Promise<any>}
|
|
888
|
+
*/
|
|
889
|
+
getIdentityNonceWithProofInfo(identity_id) {
|
|
890
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
891
|
+
const len0 = WASM_VECTOR_LEN;
|
|
892
|
+
const ret = wasm.wasmsdk_getIdentityNonceWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
893
|
+
return ret;
|
|
894
|
+
}
|
|
895
|
+
/**
|
|
896
|
+
* @param {string} identity_id
|
|
897
|
+
* @param {string} contract_id
|
|
898
|
+
* @returns {Promise<any>}
|
|
899
|
+
*/
|
|
900
|
+
getIdentityContractNonce(identity_id, contract_id) {
|
|
901
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
902
|
+
const len0 = WASM_VECTOR_LEN;
|
|
903
|
+
const ptr1 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
904
|
+
const len1 = WASM_VECTOR_LEN;
|
|
905
|
+
const ret = wasm.wasmsdk_getIdentityContractNonce(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
906
|
+
return ret;
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* @param {string} identity_id
|
|
910
|
+
* @param {string} contract_id
|
|
911
|
+
* @returns {Promise<any>}
|
|
912
|
+
*/
|
|
913
|
+
getIdentityContractNonceWithProofInfo(identity_id, contract_id) {
|
|
914
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
915
|
+
const len0 = WASM_VECTOR_LEN;
|
|
916
|
+
const ptr1 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
917
|
+
const len1 = WASM_VECTOR_LEN;
|
|
918
|
+
const ret = wasm.wasmsdk_getIdentityContractNonceWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
919
|
+
return ret;
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* @param {string} id
|
|
923
|
+
* @returns {Promise<any>}
|
|
924
|
+
*/
|
|
925
|
+
getIdentityBalance(id) {
|
|
926
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
927
|
+
const len0 = WASM_VECTOR_LEN;
|
|
928
|
+
const ret = wasm.wasmsdk_getIdentityBalance(this.__wbg_ptr, ptr0, len0);
|
|
929
|
+
return ret;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* @param {string[]} identity_ids
|
|
933
|
+
* @returns {Promise<any>}
|
|
934
|
+
*/
|
|
935
|
+
getIdentitiesBalances(identity_ids) {
|
|
936
|
+
const ptr0 = passArrayJsValueToWasm0(identity_ids, wasm.__wbindgen_malloc);
|
|
937
|
+
const len0 = WASM_VECTOR_LEN;
|
|
938
|
+
const ret = wasm.wasmsdk_getIdentitiesBalances(this.__wbg_ptr, ptr0, len0);
|
|
939
|
+
return ret;
|
|
940
|
+
}
|
|
941
|
+
/**
|
|
942
|
+
* @param {string} identity_id
|
|
943
|
+
* @returns {Promise<any>}
|
|
944
|
+
*/
|
|
945
|
+
getIdentityBalanceAndRevision(identity_id) {
|
|
946
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
947
|
+
const len0 = WASM_VECTOR_LEN;
|
|
948
|
+
const ret = wasm.wasmsdk_getIdentityBalanceAndRevision(this.__wbg_ptr, ptr0, len0);
|
|
949
|
+
return ret;
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* @param {string} public_key_hash
|
|
953
|
+
* @returns {Promise<IdentityWasm>}
|
|
954
|
+
*/
|
|
955
|
+
getIdentityByPublicKeyHash(public_key_hash) {
|
|
956
|
+
const ptr0 = passStringToWasm0(public_key_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
957
|
+
const len0 = WASM_VECTOR_LEN;
|
|
958
|
+
const ret = wasm.wasmsdk_getIdentityByPublicKeyHash(this.__wbg_ptr, ptr0, len0);
|
|
959
|
+
return ret;
|
|
960
|
+
}
|
|
961
|
+
/**
|
|
962
|
+
* @param {string[]} identities_ids
|
|
963
|
+
* @param {string} contract_id
|
|
964
|
+
* @param {Uint32Array | null} [purposes]
|
|
965
|
+
* @returns {Promise<any>}
|
|
966
|
+
*/
|
|
967
|
+
getIdentitiesContractKeys(identities_ids, contract_id, purposes) {
|
|
968
|
+
const ptr0 = passArrayJsValueToWasm0(identities_ids, wasm.__wbindgen_malloc);
|
|
969
|
+
const len0 = WASM_VECTOR_LEN;
|
|
970
|
+
const ptr1 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
971
|
+
const len1 = WASM_VECTOR_LEN;
|
|
972
|
+
var ptr2 = isLikeNone(purposes) ? 0 : passArray32ToWasm0(purposes, wasm.__wbindgen_malloc);
|
|
973
|
+
var len2 = WASM_VECTOR_LEN;
|
|
974
|
+
const ret = wasm.wasmsdk_getIdentitiesContractKeys(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
975
|
+
return ret;
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* @param {string} public_key_hash
|
|
979
|
+
* @param {string | null} [start_after]
|
|
980
|
+
* @returns {Promise<any>}
|
|
981
|
+
*/
|
|
982
|
+
getIdentityByNonUniquePublicKeyHash(public_key_hash, start_after) {
|
|
983
|
+
const ptr0 = passStringToWasm0(public_key_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
984
|
+
const len0 = WASM_VECTOR_LEN;
|
|
985
|
+
var ptr1 = isLikeNone(start_after) ? 0 : passStringToWasm0(start_after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
986
|
+
var len1 = WASM_VECTOR_LEN;
|
|
987
|
+
const ret = wasm.wasmsdk_getIdentityByNonUniquePublicKeyHash(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
988
|
+
return ret;
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* @param {string} identity_id
|
|
992
|
+
* @param {string[]} token_ids
|
|
993
|
+
* @returns {Promise<any>}
|
|
994
|
+
*/
|
|
995
|
+
getIdentityTokenBalances(identity_id, token_ids) {
|
|
996
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
997
|
+
const len0 = WASM_VECTOR_LEN;
|
|
998
|
+
const ptr1 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
999
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1000
|
+
const ret = wasm.wasmsdk_getIdentityTokenBalances(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1001
|
+
return ret;
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* @param {string} identity_id
|
|
1005
|
+
* @param {string} key_request_type
|
|
1006
|
+
* @param {Uint32Array | null} [specific_key_ids]
|
|
1007
|
+
* @param {number | null} [limit]
|
|
1008
|
+
* @param {number | null} [offset]
|
|
1009
|
+
* @returns {Promise<any>}
|
|
1010
|
+
*/
|
|
1011
|
+
getIdentityKeysWithProofInfo(identity_id, key_request_type, specific_key_ids, limit, offset) {
|
|
1012
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1013
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1014
|
+
const ptr1 = passStringToWasm0(key_request_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1015
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1016
|
+
var ptr2 = isLikeNone(specific_key_ids) ? 0 : passArray32ToWasm0(specific_key_ids, wasm.__wbindgen_malloc);
|
|
1017
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1018
|
+
const ret = wasm.wasmsdk_getIdentityKeysWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(offset) ? 0x100000001 : (offset) >>> 0);
|
|
1019
|
+
return ret;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* @param {string} id
|
|
1023
|
+
* @returns {Promise<any>}
|
|
1024
|
+
*/
|
|
1025
|
+
getIdentityBalanceWithProofInfo(id) {
|
|
1026
|
+
const ptr0 = passStringToWasm0(id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1027
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1028
|
+
const ret = wasm.wasmsdk_getIdentityBalanceWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1029
|
+
return ret;
|
|
1030
|
+
}
|
|
1031
|
+
/**
|
|
1032
|
+
* @param {string[]} identity_ids
|
|
1033
|
+
* @returns {Promise<any>}
|
|
1034
|
+
*/
|
|
1035
|
+
getIdentitiesBalancesWithProofInfo(identity_ids) {
|
|
1036
|
+
const ptr0 = passArrayJsValueToWasm0(identity_ids, wasm.__wbindgen_malloc);
|
|
1037
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1038
|
+
const ret = wasm.wasmsdk_getIdentitiesBalancesWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1039
|
+
return ret;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* @param {string} identity_id
|
|
1043
|
+
* @returns {Promise<any>}
|
|
1044
|
+
*/
|
|
1045
|
+
getIdentityBalanceAndRevisionWithProofInfo(identity_id) {
|
|
1046
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1047
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1048
|
+
const ret = wasm.wasmsdk_getIdentityBalanceAndRevisionWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1049
|
+
return ret;
|
|
1050
|
+
}
|
|
1051
|
+
/**
|
|
1052
|
+
* @param {string} public_key_hash
|
|
1053
|
+
* @returns {Promise<any>}
|
|
1054
|
+
*/
|
|
1055
|
+
getIdentityByPublicKeyHashWithProofInfo(public_key_hash) {
|
|
1056
|
+
const ptr0 = passStringToWasm0(public_key_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1057
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1058
|
+
const ret = wasm.wasmsdk_getIdentityByPublicKeyHashWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1059
|
+
return ret;
|
|
1060
|
+
}
|
|
1061
|
+
/**
|
|
1062
|
+
* @param {string} public_key_hash
|
|
1063
|
+
* @param {string | null} [start_after]
|
|
1064
|
+
* @returns {Promise<any>}
|
|
1065
|
+
*/
|
|
1066
|
+
getIdentityByNonUniquePublicKeyHashWithProofInfo(public_key_hash, start_after) {
|
|
1067
|
+
const ptr0 = passStringToWasm0(public_key_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1068
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1069
|
+
var ptr1 = isLikeNone(start_after) ? 0 : passStringToWasm0(start_after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1070
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1071
|
+
const ret = wasm.wasmsdk_getIdentityByNonUniquePublicKeyHashWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1072
|
+
return ret;
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* @param {string[]} identities_ids
|
|
1076
|
+
* @param {string} contract_id
|
|
1077
|
+
* @param {Uint32Array | null} [purposes]
|
|
1078
|
+
* @returns {Promise<any>}
|
|
1079
|
+
*/
|
|
1080
|
+
getIdentitiesContractKeysWithProofInfo(identities_ids, contract_id, purposes) {
|
|
1081
|
+
const ptr0 = passArrayJsValueToWasm0(identities_ids, wasm.__wbindgen_malloc);
|
|
1082
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1083
|
+
const ptr1 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1084
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1085
|
+
var ptr2 = isLikeNone(purposes) ? 0 : passArray32ToWasm0(purposes, wasm.__wbindgen_malloc);
|
|
1086
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1087
|
+
const ret = wasm.wasmsdk_getIdentitiesContractKeysWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1088
|
+
return ret;
|
|
1089
|
+
}
|
|
1090
|
+
/**
|
|
1091
|
+
* @param {string} identity_id
|
|
1092
|
+
* @param {string[]} token_ids
|
|
1093
|
+
* @returns {Promise<any>}
|
|
1094
|
+
*/
|
|
1095
|
+
getIdentityTokenBalancesWithProofInfo(identity_id, token_ids) {
|
|
1096
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1097
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1098
|
+
const ptr1 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
1099
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1100
|
+
const ret = wasm.wasmsdk_getIdentityTokenBalancesWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1101
|
+
return ret;
|
|
1102
|
+
}
|
|
1103
|
+
/**
|
|
1104
|
+
* @param {string} username
|
|
1105
|
+
* @returns {Promise<any>}
|
|
1106
|
+
*/
|
|
1107
|
+
getDpnsUsernameByName(username) {
|
|
1108
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1109
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1110
|
+
const ret = wasm.wasmsdk_getDpnsUsernameByName(this.__wbg_ptr, ptr0, len0);
|
|
1111
|
+
return ret;
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* @param {string} username
|
|
1115
|
+
* @returns {Promise<any>}
|
|
1116
|
+
*/
|
|
1117
|
+
getDpnsUsernameByNameWithProofInfo(username) {
|
|
1118
|
+
const ptr0 = passStringToWasm0(username, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1119
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1120
|
+
const ret = wasm.wasmsdk_getDpnsUsernameByNameWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1121
|
+
return ret;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* @param {number | null} [start_epoch]
|
|
1125
|
+
* @param {number | null} [count]
|
|
1126
|
+
* @param {boolean | null} [ascending]
|
|
1127
|
+
* @returns {Promise<any>}
|
|
1128
|
+
*/
|
|
1129
|
+
getEpochsInfo(start_epoch, count, ascending) {
|
|
1130
|
+
const ret = wasm.wasmsdk_getEpochsInfo(this.__wbg_ptr, isLikeNone(start_epoch) ? 0xFFFFFF : start_epoch, isLikeNone(count) ? 0x100000001 : (count) >>> 0, isLikeNone(ascending) ? 0xFFFFFF : ascending ? 1 : 0);
|
|
1131
|
+
return ret;
|
|
1132
|
+
}
|
|
1133
|
+
/**
|
|
1134
|
+
* @param {number | null} [start_epoch]
|
|
1135
|
+
* @param {number | null} [count]
|
|
1136
|
+
* @param {boolean | null} [ascending]
|
|
1137
|
+
* @returns {Promise<any>}
|
|
1138
|
+
*/
|
|
1139
|
+
getFinalizedEpochInfos(start_epoch, count, ascending) {
|
|
1140
|
+
const ret = wasm.wasmsdk_getFinalizedEpochInfos(this.__wbg_ptr, isLikeNone(start_epoch) ? 0xFFFFFF : start_epoch, isLikeNone(count) ? 0x100000001 : (count) >>> 0, isLikeNone(ascending) ? 0xFFFFFF : ascending ? 1 : 0);
|
|
1141
|
+
return ret;
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* @param {number} epoch
|
|
1145
|
+
* @param {string[]} ids
|
|
1146
|
+
* @returns {Promise<any>}
|
|
1147
|
+
*/
|
|
1148
|
+
getEvonodesProposedEpochBlocksByIds(epoch, ids) {
|
|
1149
|
+
const ptr0 = passArrayJsValueToWasm0(ids, wasm.__wbindgen_malloc);
|
|
1150
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1151
|
+
const ret = wasm.wasmsdk_getEvonodesProposedEpochBlocksByIds(this.__wbg_ptr, epoch, ptr0, len0);
|
|
1152
|
+
return ret;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* @param {number} epoch
|
|
1156
|
+
* @param {number | null} [limit]
|
|
1157
|
+
* @param {string | null} [start_after]
|
|
1158
|
+
* @param {boolean | null} [order_ascending]
|
|
1159
|
+
* @returns {Promise<any>}
|
|
1160
|
+
*/
|
|
1161
|
+
getEvonodesProposedEpochBlocksByRange(epoch, limit, start_after, order_ascending) {
|
|
1162
|
+
var ptr0 = isLikeNone(start_after) ? 0 : passStringToWasm0(start_after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1163
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1164
|
+
const ret = wasm.wasmsdk_getEvonodesProposedEpochBlocksByRange(this.__wbg_ptr, epoch, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, ptr0, len0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
1165
|
+
return ret;
|
|
1166
|
+
}
|
|
1167
|
+
/**
|
|
1168
|
+
* @returns {Promise<any>}
|
|
1169
|
+
*/
|
|
1170
|
+
getCurrentEpoch() {
|
|
1171
|
+
const ret = wasm.wasmsdk_getCurrentEpoch(this.__wbg_ptr);
|
|
1172
|
+
return ret;
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* @param {number | null} [start_epoch]
|
|
1176
|
+
* @param {number | null} [count]
|
|
1177
|
+
* @param {boolean | null} [ascending]
|
|
1178
|
+
* @returns {Promise<any>}
|
|
1179
|
+
*/
|
|
1180
|
+
getEpochsInfoWithProofInfo(start_epoch, count, ascending) {
|
|
1181
|
+
const ret = wasm.wasmsdk_getEpochsInfoWithProofInfo(this.__wbg_ptr, isLikeNone(start_epoch) ? 0xFFFFFF : start_epoch, isLikeNone(count) ? 0x100000001 : (count) >>> 0, isLikeNone(ascending) ? 0xFFFFFF : ascending ? 1 : 0);
|
|
1182
|
+
return ret;
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* @returns {Promise<any>}
|
|
1186
|
+
*/
|
|
1187
|
+
getCurrentEpochWithProofInfo() {
|
|
1188
|
+
const ret = wasm.wasmsdk_getCurrentEpochWithProofInfo(this.__wbg_ptr);
|
|
1189
|
+
return ret;
|
|
1190
|
+
}
|
|
1191
|
+
/**
|
|
1192
|
+
* @param {number | null} [start_epoch]
|
|
1193
|
+
* @param {number | null} [count]
|
|
1194
|
+
* @param {boolean | null} [ascending]
|
|
1195
|
+
* @returns {Promise<any>}
|
|
1196
|
+
*/
|
|
1197
|
+
getFinalizedEpochInfosWithProofInfo(start_epoch, count, ascending) {
|
|
1198
|
+
const ret = wasm.wasmsdk_getFinalizedEpochInfosWithProofInfo(this.__wbg_ptr, isLikeNone(start_epoch) ? 0xFFFFFF : start_epoch, isLikeNone(count) ? 0x100000001 : (count) >>> 0, isLikeNone(ascending) ? 0xFFFFFF : ascending ? 1 : 0);
|
|
1199
|
+
return ret;
|
|
1200
|
+
}
|
|
1201
|
+
/**
|
|
1202
|
+
* @param {number} epoch
|
|
1203
|
+
* @param {string[]} pro_tx_hashes
|
|
1204
|
+
* @returns {Promise<any>}
|
|
1205
|
+
*/
|
|
1206
|
+
getEvonodesProposedEpochBlocksByIdsWithProofInfo(epoch, pro_tx_hashes) {
|
|
1207
|
+
const ptr0 = passArrayJsValueToWasm0(pro_tx_hashes, wasm.__wbindgen_malloc);
|
|
1208
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1209
|
+
const ret = wasm.wasmsdk_getEvonodesProposedEpochBlocksByIdsWithProofInfo(this.__wbg_ptr, epoch, ptr0, len0);
|
|
1210
|
+
return ret;
|
|
1211
|
+
}
|
|
1212
|
+
/**
|
|
1213
|
+
* @param {number} epoch
|
|
1214
|
+
* @param {number | null} [limit]
|
|
1215
|
+
* @param {string | null} [start_after]
|
|
1216
|
+
* @param {boolean | null} [order_ascending]
|
|
1217
|
+
* @returns {Promise<any>}
|
|
1218
|
+
*/
|
|
1219
|
+
getEvonodesProposedEpochBlocksByRangeWithProofInfo(epoch, limit, start_after, order_ascending) {
|
|
1220
|
+
var ptr0 = isLikeNone(start_after) ? 0 : passStringToWasm0(start_after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1221
|
+
var len0 = WASM_VECTOR_LEN;
|
|
1222
|
+
const ret = wasm.wasmsdk_getEvonodesProposedEpochBlocksByRangeWithProofInfo(this.__wbg_ptr, epoch, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, ptr0, len0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
1223
|
+
return ret;
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Calculate token ID from contract ID and token position
|
|
1227
|
+
*
|
|
1228
|
+
* This function calculates the unique token ID based on a data contract ID
|
|
1229
|
+
* and the position of the token within that contract.
|
|
1230
|
+
*
|
|
1231
|
+
* # Arguments
|
|
1232
|
+
* * `contract_id` - The data contract ID in base58 format
|
|
1233
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
1234
|
+
*
|
|
1235
|
+
* # Returns
|
|
1236
|
+
* The calculated token ID in base58 format
|
|
1237
|
+
*
|
|
1238
|
+
* # Example
|
|
1239
|
+
* ```javascript
|
|
1240
|
+
* const tokenId = await sdk.calculateTokenId("Hqyu8WcRwXCTwbNxdga4CN5gsVEGc67wng4TFzceyLUv", 0);
|
|
1241
|
+
* ```
|
|
1242
|
+
* @param {string} contract_id
|
|
1243
|
+
* @param {number} token_position
|
|
1244
|
+
* @returns {string}
|
|
1245
|
+
*/
|
|
1246
|
+
static calculateTokenIdFromContract(contract_id, token_position) {
|
|
1247
|
+
let deferred3_0;
|
|
1248
|
+
let deferred3_1;
|
|
1249
|
+
try {
|
|
1250
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1251
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1252
|
+
const ret = wasm.wasmsdk_calculateTokenIdFromContract(ptr0, len0, token_position);
|
|
1253
|
+
var ptr2 = ret[0];
|
|
1254
|
+
var len2 = ret[1];
|
|
1255
|
+
if (ret[3]) {
|
|
1256
|
+
ptr2 = 0; len2 = 0;
|
|
1257
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1258
|
+
}
|
|
1259
|
+
deferred3_0 = ptr2;
|
|
1260
|
+
deferred3_1 = len2;
|
|
1261
|
+
return getStringFromWasm0(ptr2, len2);
|
|
1262
|
+
} finally {
|
|
1263
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Get the current price of a token by contract ID and position
|
|
1268
|
+
*
|
|
1269
|
+
* This is a convenience function that calculates the token ID from the contract ID
|
|
1270
|
+
* and position, then fetches the current pricing schedule for that token.
|
|
1271
|
+
*
|
|
1272
|
+
* # Arguments
|
|
1273
|
+
* * `sdk` - The WasmSdk instance
|
|
1274
|
+
* * `contract_id` - The data contract ID in base58 format
|
|
1275
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
1276
|
+
*
|
|
1277
|
+
* # Returns
|
|
1278
|
+
* An object containing:
|
|
1279
|
+
* - `tokenId`: The calculated token ID
|
|
1280
|
+
* - `currentPrice`: The current price of the token
|
|
1281
|
+
* - `basePrice`: The base price of the token (may be same as current for single price)
|
|
1282
|
+
*
|
|
1283
|
+
* # Example
|
|
1284
|
+
* ```javascript
|
|
1285
|
+
* const priceInfo = await sdk.getTokenPriceByContract(
|
|
1286
|
+
* sdk,
|
|
1287
|
+
* "Hqyu8WcRwXCTwbNxdga4CN5gsVEGc67wng4TFzceyLUv",
|
|
1288
|
+
* 0
|
|
1289
|
+
* );
|
|
1290
|
+
* console.log(`Token ${priceInfo.tokenId} current price: ${priceInfo.currentPrice}`);
|
|
1291
|
+
* ```
|
|
1292
|
+
* @param {string} contract_id
|
|
1293
|
+
* @param {number} token_position
|
|
1294
|
+
* @returns {Promise<any>}
|
|
1295
|
+
*/
|
|
1296
|
+
getTokenPriceByContract(contract_id, token_position) {
|
|
1297
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1298
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1299
|
+
const ret = wasm.wasmsdk_getTokenPriceByContract(this.__wbg_ptr, ptr0, len0, token_position);
|
|
1300
|
+
return ret;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* @param {string[]} identity_ids
|
|
1304
|
+
* @param {string} token_id
|
|
1305
|
+
* @returns {Promise<any>}
|
|
1306
|
+
*/
|
|
1307
|
+
getIdentitiesTokenBalances(identity_ids, token_id) {
|
|
1308
|
+
const ptr0 = passArrayJsValueToWasm0(identity_ids, wasm.__wbindgen_malloc);
|
|
1309
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1310
|
+
const ptr1 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1311
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1312
|
+
const ret = wasm.wasmsdk_getIdentitiesTokenBalances(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1313
|
+
return ret;
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* @param {string} identity_id
|
|
1317
|
+
* @param {string[]} token_ids
|
|
1318
|
+
* @returns {Promise<any>}
|
|
1319
|
+
*/
|
|
1320
|
+
getIdentityTokenInfos(identity_id, token_ids) {
|
|
1321
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1322
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1323
|
+
const ptr1 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
1324
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1325
|
+
const ret = wasm.wasmsdk_getIdentityTokenInfos(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1326
|
+
return ret;
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* @param {string[]} identity_ids
|
|
1330
|
+
* @param {string} token_id
|
|
1331
|
+
* @returns {Promise<any>}
|
|
1332
|
+
*/
|
|
1333
|
+
getIdentitiesTokenInfos(identity_ids, token_id) {
|
|
1334
|
+
const ptr0 = passArrayJsValueToWasm0(identity_ids, wasm.__wbindgen_malloc);
|
|
1335
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1336
|
+
const ptr1 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1337
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1338
|
+
const ret = wasm.wasmsdk_getIdentitiesTokenInfos(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1339
|
+
return ret;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* @param {string[]} token_ids
|
|
1343
|
+
* @returns {Promise<any>}
|
|
1344
|
+
*/
|
|
1345
|
+
getTokenStatuses(token_ids) {
|
|
1346
|
+
const ptr0 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
1347
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1348
|
+
const ret = wasm.wasmsdk_getTokenStatuses(this.__wbg_ptr, ptr0, len0);
|
|
1349
|
+
return ret;
|
|
1350
|
+
}
|
|
1351
|
+
/**
|
|
1352
|
+
* @param {string[]} token_ids
|
|
1353
|
+
* @returns {Promise<any>}
|
|
1354
|
+
*/
|
|
1355
|
+
getTokenDirectPurchasePrices(token_ids) {
|
|
1356
|
+
const ptr0 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
1357
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1358
|
+
const ret = wasm.wasmsdk_getTokenDirectPurchasePrices(this.__wbg_ptr, ptr0, len0);
|
|
1359
|
+
return ret;
|
|
1360
|
+
}
|
|
1361
|
+
/**
|
|
1362
|
+
* @param {string} data_contract_id
|
|
1363
|
+
* @returns {Promise<any>}
|
|
1364
|
+
*/
|
|
1365
|
+
getTokenContractInfo(data_contract_id) {
|
|
1366
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1367
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1368
|
+
const ret = wasm.wasmsdk_getTokenContractInfo(this.__wbg_ptr, ptr0, len0);
|
|
1369
|
+
return ret;
|
|
1370
|
+
}
|
|
1371
|
+
/**
|
|
1372
|
+
* @param {string} identity_id
|
|
1373
|
+
* @param {string} token_id
|
|
1374
|
+
* @returns {Promise<any>}
|
|
1375
|
+
*/
|
|
1376
|
+
getTokenPerpetualDistributionLastClaim(identity_id, token_id) {
|
|
1377
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1378
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1379
|
+
const ptr1 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1380
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1381
|
+
const ret = wasm.wasmsdk_getTokenPerpetualDistributionLastClaim(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1382
|
+
return ret;
|
|
1383
|
+
}
|
|
1384
|
+
/**
|
|
1385
|
+
* @param {string} token_id
|
|
1386
|
+
* @returns {Promise<any>}
|
|
1387
|
+
*/
|
|
1388
|
+
getTokenTotalSupply(token_id) {
|
|
1389
|
+
const ptr0 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1390
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1391
|
+
const ret = wasm.wasmsdk_getTokenTotalSupply(this.__wbg_ptr, ptr0, len0);
|
|
1392
|
+
return ret;
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* @param {string[]} identity_ids
|
|
1396
|
+
* @param {string} token_id
|
|
1397
|
+
* @returns {Promise<any>}
|
|
1398
|
+
*/
|
|
1399
|
+
getIdentitiesTokenBalancesWithProofInfo(identity_ids, token_id) {
|
|
1400
|
+
const ptr0 = passArrayJsValueToWasm0(identity_ids, wasm.__wbindgen_malloc);
|
|
1401
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1402
|
+
const ptr1 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1403
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1404
|
+
const ret = wasm.wasmsdk_getIdentitiesTokenBalancesWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1405
|
+
return ret;
|
|
1406
|
+
}
|
|
1407
|
+
/**
|
|
1408
|
+
* @param {string[]} token_ids
|
|
1409
|
+
* @returns {Promise<any>}
|
|
1410
|
+
*/
|
|
1411
|
+
getTokenStatusesWithProofInfo(token_ids) {
|
|
1412
|
+
const ptr0 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
1413
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1414
|
+
const ret = wasm.wasmsdk_getTokenStatusesWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1415
|
+
return ret;
|
|
1416
|
+
}
|
|
1417
|
+
/**
|
|
1418
|
+
* @param {string} token_id
|
|
1419
|
+
* @returns {Promise<any>}
|
|
1420
|
+
*/
|
|
1421
|
+
getTokenTotalSupplyWithProofInfo(token_id) {
|
|
1422
|
+
const ptr0 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1423
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1424
|
+
const ret = wasm.wasmsdk_getTokenTotalSupplyWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1425
|
+
return ret;
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* @param {string} identity_id
|
|
1429
|
+
* @param {string[]} token_ids
|
|
1430
|
+
* @returns {Promise<any>}
|
|
1431
|
+
*/
|
|
1432
|
+
getIdentityTokenInfosWithProofInfo(identity_id, token_ids) {
|
|
1433
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1434
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1435
|
+
const ptr1 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
1436
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1437
|
+
const ret = wasm.wasmsdk_getIdentityTokenInfosWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1438
|
+
return ret;
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* @param {string[]} identity_ids
|
|
1442
|
+
* @param {string} token_id
|
|
1443
|
+
* @returns {Promise<any>}
|
|
1444
|
+
*/
|
|
1445
|
+
getIdentitiesTokenInfosWithProofInfo(identity_ids, token_id) {
|
|
1446
|
+
const ptr0 = passArrayJsValueToWasm0(identity_ids, wasm.__wbindgen_malloc);
|
|
1447
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1448
|
+
const ptr1 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1449
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1450
|
+
const ret = wasm.wasmsdk_getIdentitiesTokenInfosWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1451
|
+
return ret;
|
|
1452
|
+
}
|
|
1453
|
+
/**
|
|
1454
|
+
* @param {string[]} token_ids
|
|
1455
|
+
* @returns {Promise<any>}
|
|
1456
|
+
*/
|
|
1457
|
+
getTokenDirectPurchasePricesWithProofInfo(token_ids) {
|
|
1458
|
+
const ptr0 = passArrayJsValueToWasm0(token_ids, wasm.__wbindgen_malloc);
|
|
1459
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1460
|
+
const ret = wasm.wasmsdk_getTokenDirectPurchasePricesWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1461
|
+
return ret;
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* @param {string} data_contract_id
|
|
1465
|
+
* @returns {Promise<any>}
|
|
1466
|
+
*/
|
|
1467
|
+
getTokenContractInfoWithProofInfo(data_contract_id) {
|
|
1468
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1469
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1470
|
+
const ret = wasm.wasmsdk_getTokenContractInfoWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1471
|
+
return ret;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* @param {string} identity_id
|
|
1475
|
+
* @param {string} token_id
|
|
1476
|
+
* @returns {Promise<any>}
|
|
1477
|
+
*/
|
|
1478
|
+
getTokenPerpetualDistributionLastClaimWithProofInfo(identity_id, token_id) {
|
|
1479
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1480
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1481
|
+
const ptr1 = passStringToWasm0(token_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1482
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1483
|
+
const ret = wasm.wasmsdk_getTokenPerpetualDistributionLastClaimWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1484
|
+
return ret;
|
|
1485
|
+
}
|
|
1486
|
+
/**
|
|
1487
|
+
* @returns {number}
|
|
1488
|
+
*/
|
|
1489
|
+
version() {
|
|
1490
|
+
const ret = wasm.wasmsdk_version(this.__wbg_ptr);
|
|
1491
|
+
return ret >>> 0;
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1494
|
+
* @returns {Promise<void>}
|
|
1495
|
+
*/
|
|
1496
|
+
static prefetchTrustedQuorumsMainnet() {
|
|
1497
|
+
const ret = wasm.wasmsdk_prefetchTrustedQuorumsMainnet();
|
|
1498
|
+
return ret;
|
|
1499
|
+
}
|
|
1500
|
+
/**
|
|
1501
|
+
* @returns {Promise<void>}
|
|
1502
|
+
*/
|
|
1503
|
+
static prefetchTrustedQuorumsTestnet() {
|
|
1504
|
+
const ret = wasm.wasmsdk_prefetchTrustedQuorumsTestnet();
|
|
1505
|
+
return ret;
|
|
1506
|
+
}
|
|
1507
|
+
/**
|
|
1508
|
+
* Configure tracing/logging level or filter (static, global)
|
|
1509
|
+
*
|
|
1510
|
+
* Accepts simple levels: "off", "error", "warn", "info", "debug", "trace"
|
|
1511
|
+
* or a full EnvFilter string like: "wasm_sdk=debug,rs_dapi_client=warn"
|
|
1512
|
+
* @param {string} level_or_filter
|
|
1513
|
+
*/
|
|
1514
|
+
static setLogLevel(level_or_filter) {
|
|
1515
|
+
const ptr0 = passStringToWasm0(level_or_filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1516
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1517
|
+
const ret = wasm.wasmsdk_setLogLevel(ptr0, len0);
|
|
1518
|
+
if (ret[1]) {
|
|
1519
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1520
|
+
}
|
|
1521
|
+
}
|
|
1522
|
+
/**
|
|
1523
|
+
* Create a new data contract on Dash Platform.
|
|
1524
|
+
*
|
|
1525
|
+
* # Arguments
|
|
1526
|
+
*
|
|
1527
|
+
* * `owner_id` - The identity ID that will own the contract
|
|
1528
|
+
* * `contract_definition` - JSON string containing the contract definition
|
|
1529
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
1530
|
+
* * `key_id` - Optional key ID to use for signing (if None, will auto-select)
|
|
1531
|
+
*
|
|
1532
|
+
* # Returns
|
|
1533
|
+
*
|
|
1534
|
+
* Returns a Promise that resolves to a JsValue containing the created contract
|
|
1535
|
+
* @param {string} owner_id
|
|
1536
|
+
* @param {string} contract_definition
|
|
1537
|
+
* @param {string} private_key_wif
|
|
1538
|
+
* @param {number | null} [key_id]
|
|
1539
|
+
* @returns {Promise<any>}
|
|
1540
|
+
*/
|
|
1541
|
+
contractCreate(owner_id, contract_definition, private_key_wif, key_id) {
|
|
1542
|
+
const ptr0 = passStringToWasm0(owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1543
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1544
|
+
const ptr1 = passStringToWasm0(contract_definition, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1545
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1546
|
+
const ptr2 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1547
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1548
|
+
const ret = wasm.wasmsdk_contractCreate(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, isLikeNone(key_id) ? 0x100000001 : (key_id) >>> 0);
|
|
1549
|
+
return ret;
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Update an existing data contract on Dash Platform.
|
|
1553
|
+
*
|
|
1554
|
+
* # Arguments
|
|
1555
|
+
*
|
|
1556
|
+
* * `contract_id` - The ID of the contract to update
|
|
1557
|
+
* * `owner_id` - The identity ID that owns the contract
|
|
1558
|
+
* * `contract_updates` - JSON string containing the updated contract definition
|
|
1559
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
1560
|
+
* * `key_id` - Optional key ID to use for signing (if None, will auto-select)
|
|
1561
|
+
*
|
|
1562
|
+
* # Returns
|
|
1563
|
+
*
|
|
1564
|
+
* Returns a Promise that resolves to a JsValue containing the update result
|
|
1565
|
+
* @param {string} contract_id
|
|
1566
|
+
* @param {string} owner_id
|
|
1567
|
+
* @param {string} contract_updates
|
|
1568
|
+
* @param {string} private_key_wif
|
|
1569
|
+
* @param {number | null} [key_id]
|
|
1570
|
+
* @returns {Promise<any>}
|
|
1571
|
+
*/
|
|
1572
|
+
contractUpdate(contract_id, owner_id, contract_updates, private_key_wif, key_id) {
|
|
1573
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1574
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1575
|
+
const ptr1 = passStringToWasm0(owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1576
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1577
|
+
const ptr2 = passStringToWasm0(contract_updates, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1578
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1579
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1580
|
+
const len3 = WASM_VECTOR_LEN;
|
|
1581
|
+
const ret = wasm.wasmsdk_contractUpdate(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(key_id) ? 0x100000001 : (key_id) >>> 0);
|
|
1582
|
+
return ret;
|
|
1583
|
+
}
|
|
1584
|
+
/**
|
|
1585
|
+
* @param {string} data_contract_id
|
|
1586
|
+
* @param {string} document_type
|
|
1587
|
+
* @param {string | null} [where_clause]
|
|
1588
|
+
* @param {string | null} [order_by]
|
|
1589
|
+
* @param {number | null} [limit]
|
|
1590
|
+
* @param {string | null} [start_after]
|
|
1591
|
+
* @param {string | null} [start_at]
|
|
1592
|
+
* @returns {Promise<any>}
|
|
1593
|
+
*/
|
|
1594
|
+
getDocuments(data_contract_id, document_type, where_clause, order_by, limit, start_after, start_at) {
|
|
1595
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1596
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1597
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1598
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1599
|
+
var ptr2 = isLikeNone(where_clause) ? 0 : passStringToWasm0(where_clause, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1600
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1601
|
+
var ptr3 = isLikeNone(order_by) ? 0 : passStringToWasm0(order_by, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1602
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1603
|
+
var ptr4 = isLikeNone(start_after) ? 0 : passStringToWasm0(start_after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1604
|
+
var len4 = WASM_VECTOR_LEN;
|
|
1605
|
+
var ptr5 = isLikeNone(start_at) ? 0 : passStringToWasm0(start_at, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1606
|
+
var len5 = WASM_VECTOR_LEN;
|
|
1607
|
+
const ret = wasm.wasmsdk_getDocuments(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, ptr4, len4, ptr5, len5);
|
|
1608
|
+
return ret;
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* @param {string} data_contract_id
|
|
1612
|
+
* @param {string} document_type
|
|
1613
|
+
* @param {string | null} [where_clause]
|
|
1614
|
+
* @param {string | null} [order_by]
|
|
1615
|
+
* @param {number | null} [limit]
|
|
1616
|
+
* @param {string | null} [start_after]
|
|
1617
|
+
* @param {string | null} [start_at]
|
|
1618
|
+
* @returns {Promise<any>}
|
|
1619
|
+
*/
|
|
1620
|
+
getDocumentsWithProofInfo(data_contract_id, document_type, where_clause, order_by, limit, start_after, start_at) {
|
|
1621
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1622
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1623
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1624
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1625
|
+
var ptr2 = isLikeNone(where_clause) ? 0 : passStringToWasm0(where_clause, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1626
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1627
|
+
var ptr3 = isLikeNone(order_by) ? 0 : passStringToWasm0(order_by, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1628
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1629
|
+
var ptr4 = isLikeNone(start_after) ? 0 : passStringToWasm0(start_after, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1630
|
+
var len4 = WASM_VECTOR_LEN;
|
|
1631
|
+
var ptr5 = isLikeNone(start_at) ? 0 : passStringToWasm0(start_at, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1632
|
+
var len5 = WASM_VECTOR_LEN;
|
|
1633
|
+
const ret = wasm.wasmsdk_getDocumentsWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, ptr4, len4, ptr5, len5);
|
|
1634
|
+
return ret;
|
|
1635
|
+
}
|
|
1636
|
+
/**
|
|
1637
|
+
* @param {string} data_contract_id
|
|
1638
|
+
* @param {string} document_type
|
|
1639
|
+
* @param {string} document_id
|
|
1640
|
+
* @returns {Promise<any>}
|
|
1641
|
+
*/
|
|
1642
|
+
getDocument(data_contract_id, document_type, document_id) {
|
|
1643
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1644
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1645
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1646
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1647
|
+
const ptr2 = passStringToWasm0(document_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1648
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1649
|
+
const ret = wasm.wasmsdk_getDocument(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1650
|
+
return ret;
|
|
1651
|
+
}
|
|
1652
|
+
/**
|
|
1653
|
+
* @param {string} data_contract_id
|
|
1654
|
+
* @param {string} document_type
|
|
1655
|
+
* @param {string} document_id
|
|
1656
|
+
* @returns {Promise<any>}
|
|
1657
|
+
*/
|
|
1658
|
+
getDocumentWithProofInfo(data_contract_id, document_type, document_id) {
|
|
1659
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1660
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1661
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1662
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1663
|
+
const ptr2 = passStringToWasm0(document_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1664
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1665
|
+
const ret = wasm.wasmsdk_getDocumentWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1666
|
+
return ret;
|
|
1667
|
+
}
|
|
1668
|
+
/**
|
|
1669
|
+
* @param {string} identity_id
|
|
1670
|
+
* @param {number | null} [limit]
|
|
1671
|
+
* @returns {Promise<any>}
|
|
1672
|
+
*/
|
|
1673
|
+
getDpnsUsernames(identity_id, limit) {
|
|
1674
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1675
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1676
|
+
const ret = wasm.wasmsdk_getDpnsUsernames(this.__wbg_ptr, ptr0, len0, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0);
|
|
1677
|
+
return ret;
|
|
1678
|
+
}
|
|
1679
|
+
/**
|
|
1680
|
+
* @param {string} identity_id
|
|
1681
|
+
* @returns {Promise<any>}
|
|
1682
|
+
*/
|
|
1683
|
+
getDpnsUsername(identity_id) {
|
|
1684
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1685
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1686
|
+
const ret = wasm.wasmsdk_getDpnsUsername(this.__wbg_ptr, ptr0, len0);
|
|
1687
|
+
return ret;
|
|
1688
|
+
}
|
|
1689
|
+
/**
|
|
1690
|
+
* @param {string} identity_id
|
|
1691
|
+
* @param {number | null} [limit]
|
|
1692
|
+
* @returns {Promise<any>}
|
|
1693
|
+
*/
|
|
1694
|
+
getDpnsUsernamesWithProofInfo(identity_id, limit) {
|
|
1695
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1696
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1697
|
+
const ret = wasm.wasmsdk_getDpnsUsernamesWithProofInfo(this.__wbg_ptr, ptr0, len0, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0);
|
|
1698
|
+
return ret;
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* @param {string} identity_id
|
|
1702
|
+
* @returns {Promise<any>}
|
|
1703
|
+
*/
|
|
1704
|
+
getDpnsUsernameWithProofInfo(identity_id) {
|
|
1705
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1706
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1707
|
+
const ret = wasm.wasmsdk_getDpnsUsernameWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1708
|
+
return ret;
|
|
1709
|
+
}
|
|
1710
|
+
/**
|
|
1711
|
+
* @param {string} data_contract_id
|
|
1712
|
+
* @param {number} group_contract_position
|
|
1713
|
+
* @returns {Promise<any>}
|
|
1714
|
+
*/
|
|
1715
|
+
getGroupInfo(data_contract_id, group_contract_position) {
|
|
1716
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1717
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1718
|
+
const ret = wasm.wasmsdk_getGroupInfo(this.__wbg_ptr, ptr0, len0, group_contract_position);
|
|
1719
|
+
return ret;
|
|
1720
|
+
}
|
|
1721
|
+
/**
|
|
1722
|
+
* @param {string} data_contract_id
|
|
1723
|
+
* @param {number} group_contract_position
|
|
1724
|
+
* @param {string[] | null} [member_ids]
|
|
1725
|
+
* @param {string | null} [start_at]
|
|
1726
|
+
* @param {number | null} [limit]
|
|
1727
|
+
* @returns {Promise<any>}
|
|
1728
|
+
*/
|
|
1729
|
+
getGroupMembers(data_contract_id, group_contract_position, member_ids, start_at, limit) {
|
|
1730
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1731
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1732
|
+
var ptr1 = isLikeNone(member_ids) ? 0 : passArrayJsValueToWasm0(member_ids, wasm.__wbindgen_malloc);
|
|
1733
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1734
|
+
var ptr2 = isLikeNone(start_at) ? 0 : passStringToWasm0(start_at, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1735
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1736
|
+
const ret = wasm.wasmsdk_getGroupMembers(this.__wbg_ptr, ptr0, len0, group_contract_position, ptr1, len1, ptr2, len2, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0);
|
|
1737
|
+
return ret;
|
|
1738
|
+
}
|
|
1739
|
+
/**
|
|
1740
|
+
* @param {string} identity_id
|
|
1741
|
+
* @param {string[] | null} [member_data_contracts]
|
|
1742
|
+
* @param {string[] | null} [owner_data_contracts]
|
|
1743
|
+
* @param {string[] | null} [moderator_data_contracts]
|
|
1744
|
+
* @returns {Promise<any>}
|
|
1745
|
+
*/
|
|
1746
|
+
getIdentityGroups(identity_id, member_data_contracts, owner_data_contracts, moderator_data_contracts) {
|
|
1747
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1748
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1749
|
+
var ptr1 = isLikeNone(member_data_contracts) ? 0 : passArrayJsValueToWasm0(member_data_contracts, wasm.__wbindgen_malloc);
|
|
1750
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1751
|
+
var ptr2 = isLikeNone(owner_data_contracts) ? 0 : passArrayJsValueToWasm0(owner_data_contracts, wasm.__wbindgen_malloc);
|
|
1752
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1753
|
+
var ptr3 = isLikeNone(moderator_data_contracts) ? 0 : passArrayJsValueToWasm0(moderator_data_contracts, wasm.__wbindgen_malloc);
|
|
1754
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1755
|
+
const ret = wasm.wasmsdk_getIdentityGroups(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1756
|
+
return ret;
|
|
1757
|
+
}
|
|
1758
|
+
/**
|
|
1759
|
+
* @param {string} contract_id
|
|
1760
|
+
* @param {any} start_at_info
|
|
1761
|
+
* @param {number | null} [count]
|
|
1762
|
+
* @returns {Promise<any>}
|
|
1763
|
+
*/
|
|
1764
|
+
getGroupInfos(contract_id, start_at_info, count) {
|
|
1765
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1766
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1767
|
+
const ret = wasm.wasmsdk_getGroupInfos(this.__wbg_ptr, ptr0, len0, start_at_info, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
1768
|
+
return ret;
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* @param {string} contract_id
|
|
1772
|
+
* @param {number} group_contract_position
|
|
1773
|
+
* @param {string} status
|
|
1774
|
+
* @param {any} start_at_info
|
|
1775
|
+
* @param {number | null} [count]
|
|
1776
|
+
* @returns {Promise<any>}
|
|
1777
|
+
*/
|
|
1778
|
+
getGroupActions(contract_id, group_contract_position, status, start_at_info, count) {
|
|
1779
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1780
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1781
|
+
const ptr1 = passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1782
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1783
|
+
const ret = wasm.wasmsdk_getGroupActions(this.__wbg_ptr, ptr0, len0, group_contract_position, ptr1, len1, start_at_info, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
1784
|
+
return ret;
|
|
1785
|
+
}
|
|
1786
|
+
/**
|
|
1787
|
+
* @param {string} contract_id
|
|
1788
|
+
* @param {number} group_contract_position
|
|
1789
|
+
* @param {string} status
|
|
1790
|
+
* @param {string} action_id
|
|
1791
|
+
* @returns {Promise<any>}
|
|
1792
|
+
*/
|
|
1793
|
+
getGroupActionSigners(contract_id, group_contract_position, status, action_id) {
|
|
1794
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1795
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1796
|
+
const ptr1 = passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1797
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1798
|
+
const ptr2 = passStringToWasm0(action_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1799
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1800
|
+
const ret = wasm.wasmsdk_getGroupActionSigners(this.__wbg_ptr, ptr0, len0, group_contract_position, ptr1, len1, ptr2, len2);
|
|
1801
|
+
return ret;
|
|
1802
|
+
}
|
|
1803
|
+
/**
|
|
1804
|
+
* @param {string[]} data_contract_ids
|
|
1805
|
+
* @returns {Promise<any>}
|
|
1806
|
+
*/
|
|
1807
|
+
getGroupsDataContracts(data_contract_ids) {
|
|
1808
|
+
const ptr0 = passArrayJsValueToWasm0(data_contract_ids, wasm.__wbindgen_malloc);
|
|
1809
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1810
|
+
const ret = wasm.wasmsdk_getGroupsDataContracts(this.__wbg_ptr, ptr0, len0);
|
|
1811
|
+
return ret;
|
|
1812
|
+
}
|
|
1813
|
+
/**
|
|
1814
|
+
* @param {string} data_contract_id
|
|
1815
|
+
* @param {number} group_contract_position
|
|
1816
|
+
* @returns {Promise<any>}
|
|
1817
|
+
*/
|
|
1818
|
+
getGroupInfoWithProofInfo(data_contract_id, group_contract_position) {
|
|
1819
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1820
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1821
|
+
const ret = wasm.wasmsdk_getGroupInfoWithProofInfo(this.__wbg_ptr, ptr0, len0, group_contract_position);
|
|
1822
|
+
return ret;
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1825
|
+
* @param {string} contract_id
|
|
1826
|
+
* @param {any} start_at_info
|
|
1827
|
+
* @param {number | null} [count]
|
|
1828
|
+
* @returns {Promise<any>}
|
|
1829
|
+
*/
|
|
1830
|
+
getGroupInfosWithProofInfo(contract_id, start_at_info, count) {
|
|
1831
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1832
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1833
|
+
const ret = wasm.wasmsdk_getGroupInfosWithProofInfo(this.__wbg_ptr, ptr0, len0, start_at_info, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
1834
|
+
return ret;
|
|
1835
|
+
}
|
|
1836
|
+
/**
|
|
1837
|
+
* @param {string} data_contract_id
|
|
1838
|
+
* @param {number} group_contract_position
|
|
1839
|
+
* @param {string[] | null} [member_ids]
|
|
1840
|
+
* @param {string | null} [start_at]
|
|
1841
|
+
* @param {number | null} [limit]
|
|
1842
|
+
* @returns {Promise<any>}
|
|
1843
|
+
*/
|
|
1844
|
+
getGroupMembersWithProofInfo(data_contract_id, group_contract_position, member_ids, start_at, limit) {
|
|
1845
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1846
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1847
|
+
var ptr1 = isLikeNone(member_ids) ? 0 : passArrayJsValueToWasm0(member_ids, wasm.__wbindgen_malloc);
|
|
1848
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1849
|
+
var ptr2 = isLikeNone(start_at) ? 0 : passStringToWasm0(start_at, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1850
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1851
|
+
const ret = wasm.wasmsdk_getGroupMembersWithProofInfo(this.__wbg_ptr, ptr0, len0, group_contract_position, ptr1, len1, ptr2, len2, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0);
|
|
1852
|
+
return ret;
|
|
1853
|
+
}
|
|
1854
|
+
/**
|
|
1855
|
+
* @param {string} identity_id
|
|
1856
|
+
* @param {string[] | null} [member_data_contracts]
|
|
1857
|
+
* @param {string[] | null} [owner_data_contracts]
|
|
1858
|
+
* @param {string[] | null} [moderator_data_contracts]
|
|
1859
|
+
* @returns {Promise<any>}
|
|
1860
|
+
*/
|
|
1861
|
+
getIdentityGroupsWithProofInfo(identity_id, member_data_contracts, owner_data_contracts, moderator_data_contracts) {
|
|
1862
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1863
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1864
|
+
var ptr1 = isLikeNone(member_data_contracts) ? 0 : passArrayJsValueToWasm0(member_data_contracts, wasm.__wbindgen_malloc);
|
|
1865
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1866
|
+
var ptr2 = isLikeNone(owner_data_contracts) ? 0 : passArrayJsValueToWasm0(owner_data_contracts, wasm.__wbindgen_malloc);
|
|
1867
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1868
|
+
var ptr3 = isLikeNone(moderator_data_contracts) ? 0 : passArrayJsValueToWasm0(moderator_data_contracts, wasm.__wbindgen_malloc);
|
|
1869
|
+
var len3 = WASM_VECTOR_LEN;
|
|
1870
|
+
const ret = wasm.wasmsdk_getIdentityGroupsWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
1871
|
+
return ret;
|
|
1872
|
+
}
|
|
1873
|
+
/**
|
|
1874
|
+
* @param {string} contract_id
|
|
1875
|
+
* @param {number} group_contract_position
|
|
1876
|
+
* @param {string} status
|
|
1877
|
+
* @param {any} start_at_info
|
|
1878
|
+
* @param {number | null} [count]
|
|
1879
|
+
* @returns {Promise<any>}
|
|
1880
|
+
*/
|
|
1881
|
+
getGroupActionsWithProofInfo(contract_id, group_contract_position, status, start_at_info, count) {
|
|
1882
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1883
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1884
|
+
const ptr1 = passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1885
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1886
|
+
const ret = wasm.wasmsdk_getGroupActionsWithProofInfo(this.__wbg_ptr, ptr0, len0, group_contract_position, ptr1, len1, start_at_info, isLikeNone(count) ? 0x100000001 : (count) >>> 0);
|
|
1887
|
+
return ret;
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* @param {string} contract_id
|
|
1891
|
+
* @param {number} group_contract_position
|
|
1892
|
+
* @param {string} status
|
|
1893
|
+
* @param {string} action_id
|
|
1894
|
+
* @returns {Promise<any>}
|
|
1895
|
+
*/
|
|
1896
|
+
getGroupActionSignersWithProofInfo(contract_id, group_contract_position, status, action_id) {
|
|
1897
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1898
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1899
|
+
const ptr1 = passStringToWasm0(status, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1900
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1901
|
+
const ptr2 = passStringToWasm0(action_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1902
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1903
|
+
const ret = wasm.wasmsdk_getGroupActionSignersWithProofInfo(this.__wbg_ptr, ptr0, len0, group_contract_position, ptr1, len1, ptr2, len2);
|
|
1904
|
+
return ret;
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* @param {string[]} data_contract_ids
|
|
1908
|
+
* @returns {Promise<any>}
|
|
1909
|
+
*/
|
|
1910
|
+
getGroupsDataContractsWithProofInfo(data_contract_ids) {
|
|
1911
|
+
const ptr0 = passArrayJsValueToWasm0(data_contract_ids, wasm.__wbindgen_malloc);
|
|
1912
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1913
|
+
const ret = wasm.wasmsdk_getGroupsDataContractsWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
1914
|
+
return ret;
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
* @returns {Promise<any>}
|
|
1918
|
+
*/
|
|
1919
|
+
getProtocolVersionUpgradeState() {
|
|
1920
|
+
const ret = wasm.wasmsdk_getProtocolVersionUpgradeState(this.__wbg_ptr);
|
|
1921
|
+
return ret;
|
|
1922
|
+
}
|
|
1923
|
+
/**
|
|
1924
|
+
* @param {string} start_pro_tx_hash
|
|
1925
|
+
* @param {number} count
|
|
1926
|
+
* @returns {Promise<any>}
|
|
1927
|
+
*/
|
|
1928
|
+
getProtocolVersionUpgradeVoteStatus(start_pro_tx_hash, count) {
|
|
1929
|
+
const ptr0 = passStringToWasm0(start_pro_tx_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1930
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1931
|
+
const ret = wasm.wasmsdk_getProtocolVersionUpgradeVoteStatus(this.__wbg_ptr, ptr0, len0, count);
|
|
1932
|
+
return ret;
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* @returns {Promise<any>}
|
|
1936
|
+
*/
|
|
1937
|
+
getProtocolVersionUpgradeStateWithProofInfo() {
|
|
1938
|
+
const ret = wasm.wasmsdk_getProtocolVersionUpgradeStateWithProofInfo(this.__wbg_ptr);
|
|
1939
|
+
return ret;
|
|
1940
|
+
}
|
|
1941
|
+
/**
|
|
1942
|
+
* @param {string} start_pro_tx_hash
|
|
1943
|
+
* @param {number} count
|
|
1944
|
+
* @returns {Promise<any>}
|
|
1945
|
+
*/
|
|
1946
|
+
getProtocolVersionUpgradeVoteStatusWithProofInfo(start_pro_tx_hash, count) {
|
|
1947
|
+
const ptr0 = passStringToWasm0(start_pro_tx_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1948
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1949
|
+
const ret = wasm.wasmsdk_getProtocolVersionUpgradeVoteStatusWithProofInfo(this.__wbg_ptr, ptr0, len0, count);
|
|
1950
|
+
return ret;
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* @returns {Promise<any>}
|
|
1954
|
+
*/
|
|
1955
|
+
getStatus() {
|
|
1956
|
+
const ret = wasm.wasmsdk_getStatus(this.__wbg_ptr);
|
|
1957
|
+
return ret;
|
|
1958
|
+
}
|
|
1959
|
+
/**
|
|
1960
|
+
* @returns {Promise<any>}
|
|
1961
|
+
*/
|
|
1962
|
+
getCurrentQuorumsInfo() {
|
|
1963
|
+
const ret = wasm.wasmsdk_getCurrentQuorumsInfo(this.__wbg_ptr);
|
|
1964
|
+
return ret;
|
|
1965
|
+
}
|
|
1966
|
+
/**
|
|
1967
|
+
* @returns {Promise<any>}
|
|
1968
|
+
*/
|
|
1969
|
+
getTotalCreditsInPlatform() {
|
|
1970
|
+
const ret = wasm.wasmsdk_getTotalCreditsInPlatform(this.__wbg_ptr);
|
|
1971
|
+
return ret;
|
|
1972
|
+
}
|
|
1973
|
+
/**
|
|
1974
|
+
* @param {string} identity_id
|
|
1975
|
+
* @returns {Promise<any>}
|
|
1976
|
+
*/
|
|
1977
|
+
getPrefundedSpecializedBalance(identity_id) {
|
|
1978
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1979
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1980
|
+
const ret = wasm.wasmsdk_getPrefundedSpecializedBalance(this.__wbg_ptr, ptr0, len0);
|
|
1981
|
+
return ret;
|
|
1982
|
+
}
|
|
1983
|
+
/**
|
|
1984
|
+
* @param {string} state_transition_hash
|
|
1985
|
+
* @returns {Promise<any>}
|
|
1986
|
+
*/
|
|
1987
|
+
waitForStateTransitionResult(state_transition_hash) {
|
|
1988
|
+
const ptr0 = passStringToWasm0(state_transition_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1989
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1990
|
+
const ret = wasm.wasmsdk_waitForStateTransitionResult(this.__wbg_ptr, ptr0, len0);
|
|
1991
|
+
return ret;
|
|
1992
|
+
}
|
|
1993
|
+
/**
|
|
1994
|
+
* @param {string[]} path
|
|
1995
|
+
* @param {string[]} keys
|
|
1996
|
+
* @returns {Promise<any>}
|
|
1997
|
+
*/
|
|
1998
|
+
getPathElements(path, keys) {
|
|
1999
|
+
const ptr0 = passArrayJsValueToWasm0(path, wasm.__wbindgen_malloc);
|
|
2000
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2001
|
+
const ptr1 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_malloc);
|
|
2002
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2003
|
+
const ret = wasm.wasmsdk_getPathElements(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2004
|
+
return ret;
|
|
2005
|
+
}
|
|
2006
|
+
/**
|
|
2007
|
+
* @returns {Promise<any>}
|
|
2008
|
+
*/
|
|
2009
|
+
getTotalCreditsInPlatformWithProofInfo() {
|
|
2010
|
+
const ret = wasm.wasmsdk_getTotalCreditsInPlatformWithProofInfo(this.__wbg_ptr);
|
|
2011
|
+
return ret;
|
|
2012
|
+
}
|
|
2013
|
+
/**
|
|
2014
|
+
* @param {string} identity_id
|
|
2015
|
+
* @returns {Promise<any>}
|
|
2016
|
+
*/
|
|
2017
|
+
getPrefundedSpecializedBalanceWithProofInfo(identity_id) {
|
|
2018
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2019
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2020
|
+
const ret = wasm.wasmsdk_getPrefundedSpecializedBalanceWithProofInfo(this.__wbg_ptr, ptr0, len0);
|
|
2021
|
+
return ret;
|
|
2022
|
+
}
|
|
2023
|
+
/**
|
|
2024
|
+
* @param {string[]} path
|
|
2025
|
+
* @param {string[]} keys
|
|
2026
|
+
* @returns {Promise<any>}
|
|
2027
|
+
*/
|
|
2028
|
+
getPathElementsWithProofInfo(path, keys) {
|
|
2029
|
+
const ptr0 = passArrayJsValueToWasm0(path, wasm.__wbindgen_malloc);
|
|
2030
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2031
|
+
const ptr1 = passArrayJsValueToWasm0(keys, wasm.__wbindgen_malloc);
|
|
2032
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2033
|
+
const ret = wasm.wasmsdk_getPathElementsWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2034
|
+
return ret;
|
|
2035
|
+
}
|
|
2036
|
+
/**
|
|
2037
|
+
* Generate a new mnemonic phrase
|
|
2038
|
+
* @param {number | null} [word_count]
|
|
2039
|
+
* @param {string | null} [language_code]
|
|
2040
|
+
* @returns {string}
|
|
2041
|
+
*/
|
|
2042
|
+
static generateMnemonic(word_count, language_code) {
|
|
2043
|
+
let deferred3_0;
|
|
2044
|
+
let deferred3_1;
|
|
2045
|
+
try {
|
|
2046
|
+
var ptr0 = isLikeNone(language_code) ? 0 : passStringToWasm0(language_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2047
|
+
var len0 = WASM_VECTOR_LEN;
|
|
2048
|
+
const ret = wasm.wasmsdk_generateMnemonic(isLikeNone(word_count) ? 0x100000001 : (word_count) >>> 0, ptr0, len0);
|
|
2049
|
+
var ptr2 = ret[0];
|
|
2050
|
+
var len2 = ret[1];
|
|
2051
|
+
if (ret[3]) {
|
|
2052
|
+
ptr2 = 0; len2 = 0;
|
|
2053
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2054
|
+
}
|
|
2055
|
+
deferred3_0 = ptr2;
|
|
2056
|
+
deferred3_1 = len2;
|
|
2057
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2058
|
+
} finally {
|
|
2059
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
/**
|
|
2063
|
+
* Validate a mnemonic phrase
|
|
2064
|
+
* @param {string} mnemonic
|
|
2065
|
+
* @param {string | null} [language_code]
|
|
2066
|
+
* @returns {boolean}
|
|
2067
|
+
*/
|
|
2068
|
+
static validateMnemonic(mnemonic, language_code) {
|
|
2069
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2070
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2071
|
+
var ptr1 = isLikeNone(language_code) ? 0 : passStringToWasm0(language_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2072
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2073
|
+
const ret = wasm.wasmsdk_validateMnemonic(ptr0, len0, ptr1, len1);
|
|
2074
|
+
return ret !== 0;
|
|
2075
|
+
}
|
|
2076
|
+
/**
|
|
2077
|
+
* Derive a seed from a mnemonic phrase
|
|
2078
|
+
* @param {string} mnemonic
|
|
2079
|
+
* @param {string | null} [passphrase]
|
|
2080
|
+
* @returns {Uint8Array}
|
|
2081
|
+
*/
|
|
2082
|
+
static mnemonicToSeed(mnemonic, passphrase) {
|
|
2083
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2084
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2085
|
+
var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2086
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2087
|
+
const ret = wasm.wasmsdk_mnemonicToSeed(ptr0, len0, ptr1, len1);
|
|
2088
|
+
if (ret[3]) {
|
|
2089
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2090
|
+
}
|
|
2091
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
2092
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
2093
|
+
return v3;
|
|
2094
|
+
}
|
|
2095
|
+
/**
|
|
2096
|
+
* Derive a key from mnemonic phrase using BIP39/BIP44
|
|
2097
|
+
* @param {string} mnemonic
|
|
2098
|
+
* @param {string | null | undefined} passphrase
|
|
2099
|
+
* @param {string} network
|
|
2100
|
+
* @returns {any}
|
|
2101
|
+
*/
|
|
2102
|
+
static deriveKeyFromSeedPhrase(mnemonic, passphrase, network) {
|
|
2103
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2104
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2105
|
+
var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2106
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2107
|
+
const ptr2 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2108
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2109
|
+
const ret = wasm.wasmsdk_deriveKeyFromSeedPhrase(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
2110
|
+
if (ret[2]) {
|
|
2111
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2112
|
+
}
|
|
2113
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Derive a key from seed phrase with arbitrary path
|
|
2117
|
+
* @param {string} mnemonic
|
|
2118
|
+
* @param {string | null | undefined} passphrase
|
|
2119
|
+
* @param {string} path
|
|
2120
|
+
* @param {string} network
|
|
2121
|
+
* @returns {any}
|
|
2122
|
+
*/
|
|
2123
|
+
static deriveKeyFromSeedWithPath(mnemonic, passphrase, path, network) {
|
|
2124
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2126
|
+
var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2127
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2128
|
+
const ptr2 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2129
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2130
|
+
const ptr3 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2131
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2132
|
+
const ret = wasm.wasmsdk_deriveKeyFromSeedWithPath(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
2133
|
+
if (ret[2]) {
|
|
2134
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
2135
|
+
}
|
|
2136
|
+
return takeFromExternrefTable0(ret[0]);
|
|
2137
|
+
}
|
|
2138
|
+
/**
|
|
2139
|
+
* Create a BIP44 mainnet derivation path
|
|
2140
|
+
* @param {number} account
|
|
2141
|
+
* @param {number} change
|
|
2142
|
+
* @param {number} index
|
|
2143
|
+
* @returns {any}
|
|
2144
|
+
*/
|
|
2145
|
+
static derivationPathBip44Mainnet(account, change, index) {
|
|
2146
|
+
const ret = wasm.wasmsdk_derivationPathBip44Mainnet(account, change, index);
|
|
2147
|
+
return ret;
|
|
2148
|
+
}
|
|
2149
|
+
/**
|
|
2150
|
+
* Create a BIP44 testnet derivation path
|
|
2151
|
+
* @param {number} account
|
|
2152
|
+
* @param {number} change
|
|
2153
|
+
* @param {number} index
|
|
2154
|
+
* @returns {any}
|
|
2155
|
+
*/
|
|
2156
|
+
static derivationPathBip44Testnet(account, change, index) {
|
|
2157
|
+
const ret = wasm.wasmsdk_derivationPathBip44Testnet(account, change, index);
|
|
2158
|
+
return ret;
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* Create a DIP9 mainnet derivation path
|
|
2162
|
+
* @param {number} feature_type
|
|
2163
|
+
* @param {number} account
|
|
2164
|
+
* @param {number} index
|
|
2165
|
+
* @returns {any}
|
|
2166
|
+
*/
|
|
2167
|
+
static derivationPathDip9Mainnet(feature_type, account, index) {
|
|
2168
|
+
const ret = wasm.wasmsdk_derivationPathDip9Mainnet(feature_type, account, index);
|
|
2169
|
+
return ret;
|
|
2170
|
+
}
|
|
2171
|
+
/**
|
|
2172
|
+
* Create a DIP9 testnet derivation path
|
|
2173
|
+
* @param {number} feature_type
|
|
2174
|
+
* @param {number} account
|
|
2175
|
+
* @param {number} index
|
|
2176
|
+
* @returns {any}
|
|
2177
|
+
*/
|
|
2178
|
+
static derivationPathDip9Testnet(feature_type, account, index) {
|
|
2179
|
+
const ret = wasm.wasmsdk_derivationPathDip9Testnet(feature_type, account, index);
|
|
2180
|
+
return ret;
|
|
2181
|
+
}
|
|
2182
|
+
/**
|
|
2183
|
+
* Create a DIP13 mainnet derivation path (for HD masternode keys)
|
|
2184
|
+
* @param {number} account
|
|
2185
|
+
* @returns {any}
|
|
2186
|
+
*/
|
|
2187
|
+
static derivationPathDip13Mainnet(account) {
|
|
2188
|
+
const ret = wasm.wasmsdk_derivationPathDip13Mainnet(account);
|
|
2189
|
+
return ret;
|
|
2190
|
+
}
|
|
2191
|
+
/**
|
|
2192
|
+
* Create a DIP13 testnet derivation path (for HD masternode keys)
|
|
2193
|
+
* @param {number} account
|
|
2194
|
+
* @returns {any}
|
|
2195
|
+
*/
|
|
2196
|
+
static derivationPathDip13Testnet(account) {
|
|
2197
|
+
const ret = wasm.wasmsdk_derivationPathDip13Testnet(account);
|
|
2198
|
+
return ret;
|
|
2199
|
+
}
|
|
2200
|
+
/**
|
|
2201
|
+
* Get child public key from extended public key
|
|
2202
|
+
* @param {string} xpub
|
|
2203
|
+
* @param {number} index
|
|
2204
|
+
* @param {boolean} hardened
|
|
2205
|
+
* @returns {string}
|
|
2206
|
+
*/
|
|
2207
|
+
static deriveChildPublicKey(xpub, index, hardened) {
|
|
2208
|
+
let deferred3_0;
|
|
2209
|
+
let deferred3_1;
|
|
2210
|
+
try {
|
|
2211
|
+
const ptr0 = passStringToWasm0(xpub, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2212
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2213
|
+
const ret = wasm.wasmsdk_deriveChildPublicKey(ptr0, len0, index, hardened);
|
|
2214
|
+
var ptr2 = ret[0];
|
|
2215
|
+
var len2 = ret[1];
|
|
2216
|
+
if (ret[3]) {
|
|
2217
|
+
ptr2 = 0; len2 = 0;
|
|
2218
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2219
|
+
}
|
|
2220
|
+
deferred3_0 = ptr2;
|
|
2221
|
+
deferred3_1 = len2;
|
|
2222
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2223
|
+
} finally {
|
|
2224
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2225
|
+
}
|
|
2226
|
+
}
|
|
2227
|
+
/**
|
|
2228
|
+
* Convert extended private key to extended public key
|
|
2229
|
+
* @param {string} xprv
|
|
2230
|
+
* @returns {string}
|
|
2231
|
+
*/
|
|
2232
|
+
static xprvToXpub(xprv) {
|
|
2233
|
+
let deferred3_0;
|
|
2234
|
+
let deferred3_1;
|
|
2235
|
+
try {
|
|
2236
|
+
const ptr0 = passStringToWasm0(xprv, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2237
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2238
|
+
const ret = wasm.wasmsdk_xprvToXpub(ptr0, len0);
|
|
2239
|
+
var ptr2 = ret[0];
|
|
2240
|
+
var len2 = ret[1];
|
|
2241
|
+
if (ret[3]) {
|
|
2242
|
+
ptr2 = 0; len2 = 0;
|
|
2243
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2244
|
+
}
|
|
2245
|
+
deferred3_0 = ptr2;
|
|
2246
|
+
deferred3_1 = len2;
|
|
2247
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2248
|
+
} finally {
|
|
2249
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
/**
|
|
2253
|
+
* Create a new document on the platform.
|
|
2254
|
+
*
|
|
2255
|
+
* # Arguments
|
|
2256
|
+
*
|
|
2257
|
+
* * `data_contract_id` - The ID of the data contract
|
|
2258
|
+
* * `document_type` - The name of the document type
|
|
2259
|
+
* * `owner_id` - The identity ID of the document owner
|
|
2260
|
+
* * `document_data` - The document data as a JSON string
|
|
2261
|
+
* * `entropy` - 32 bytes of entropy for the state transition (hex string)
|
|
2262
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2263
|
+
*
|
|
2264
|
+
* # Returns
|
|
2265
|
+
*
|
|
2266
|
+
* Returns a Promise that resolves to a JsValue containing the created document
|
|
2267
|
+
* @param {string} data_contract_id
|
|
2268
|
+
* @param {string} document_type
|
|
2269
|
+
* @param {string} owner_id
|
|
2270
|
+
* @param {string} document_data
|
|
2271
|
+
* @param {string} entropy
|
|
2272
|
+
* @param {string} private_key_wif
|
|
2273
|
+
* @returns {Promise<any>}
|
|
2274
|
+
*/
|
|
2275
|
+
documentCreate(data_contract_id, document_type, owner_id, document_data, entropy, private_key_wif) {
|
|
2276
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2277
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2278
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2279
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2280
|
+
const ptr2 = passStringToWasm0(owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2281
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2282
|
+
const ptr3 = passStringToWasm0(document_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2283
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2284
|
+
const ptr4 = passStringToWasm0(entropy, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2285
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2286
|
+
const ptr5 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2287
|
+
const len5 = WASM_VECTOR_LEN;
|
|
2288
|
+
const ret = wasm.wasmsdk_documentCreate(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
2289
|
+
return ret;
|
|
2290
|
+
}
|
|
2291
|
+
/**
|
|
2292
|
+
* Replace an existing document on the platform.
|
|
2293
|
+
*
|
|
2294
|
+
* # Arguments
|
|
2295
|
+
*
|
|
2296
|
+
* * `data_contract_id` - The ID of the data contract
|
|
2297
|
+
* * `document_type` - The name of the document type
|
|
2298
|
+
* * `document_id` - The ID of the document to replace
|
|
2299
|
+
* * `owner_id` - The identity ID of the document owner
|
|
2300
|
+
* * `document_data` - The new document data as a JSON string
|
|
2301
|
+
* * `revision` - The current revision of the document
|
|
2302
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2303
|
+
*
|
|
2304
|
+
* # Returns
|
|
2305
|
+
*
|
|
2306
|
+
* Returns a Promise that resolves to a JsValue containing the replaced document
|
|
2307
|
+
* @param {string} data_contract_id
|
|
2308
|
+
* @param {string} document_type
|
|
2309
|
+
* @param {string} document_id
|
|
2310
|
+
* @param {string} owner_id
|
|
2311
|
+
* @param {string} document_data
|
|
2312
|
+
* @param {bigint} revision
|
|
2313
|
+
* @param {string} private_key_wif
|
|
2314
|
+
* @returns {Promise<any>}
|
|
2315
|
+
*/
|
|
2316
|
+
documentReplace(data_contract_id, document_type, document_id, owner_id, document_data, revision, private_key_wif) {
|
|
2317
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2318
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2319
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2320
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2321
|
+
const ptr2 = passStringToWasm0(document_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2322
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2323
|
+
const ptr3 = passStringToWasm0(owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2324
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2325
|
+
const ptr4 = passStringToWasm0(document_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2326
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2327
|
+
const ptr5 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2328
|
+
const len5 = WASM_VECTOR_LEN;
|
|
2329
|
+
const ret = wasm.wasmsdk_documentReplace(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, revision, ptr5, len5);
|
|
2330
|
+
return ret;
|
|
2331
|
+
}
|
|
2332
|
+
/**
|
|
2333
|
+
* Delete a document from the platform.
|
|
2334
|
+
*
|
|
2335
|
+
* # Arguments
|
|
2336
|
+
*
|
|
2337
|
+
* * `data_contract_id` - The ID of the data contract
|
|
2338
|
+
* * `document_type` - The name of the document type
|
|
2339
|
+
* * `document_id` - The ID of the document to delete
|
|
2340
|
+
* * `owner_id` - The identity ID of the document owner
|
|
2341
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2342
|
+
*
|
|
2343
|
+
* # Returns
|
|
2344
|
+
*
|
|
2345
|
+
* Returns a Promise that resolves to a JsValue confirming deletion
|
|
2346
|
+
* @param {string} data_contract_id
|
|
2347
|
+
* @param {string} document_type
|
|
2348
|
+
* @param {string} document_id
|
|
2349
|
+
* @param {string} owner_id
|
|
2350
|
+
* @param {string} private_key_wif
|
|
2351
|
+
* @returns {Promise<any>}
|
|
2352
|
+
*/
|
|
2353
|
+
documentDelete(data_contract_id, document_type, document_id, owner_id, private_key_wif) {
|
|
2354
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2355
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2356
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2357
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2358
|
+
const ptr2 = passStringToWasm0(document_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2359
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2360
|
+
const ptr3 = passStringToWasm0(owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2361
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2362
|
+
const ptr4 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2363
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2364
|
+
const ret = wasm.wasmsdk_documentDelete(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
2365
|
+
return ret;
|
|
2366
|
+
}
|
|
2367
|
+
/**
|
|
2368
|
+
* Transfer document ownership to another identity.
|
|
2369
|
+
*
|
|
2370
|
+
* # Arguments
|
|
2371
|
+
*
|
|
2372
|
+
* * `data_contract_id` - The ID of the data contract
|
|
2373
|
+
* * `document_type` - The name of the document type
|
|
2374
|
+
* * `document_id` - The ID of the document to transfer
|
|
2375
|
+
* * `owner_id` - The current owner's identity ID
|
|
2376
|
+
* * `recipient_id` - The new owner's identity ID
|
|
2377
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2378
|
+
*
|
|
2379
|
+
* # Returns
|
|
2380
|
+
*
|
|
2381
|
+
* Returns a Promise that resolves to a JsValue containing the transfer result
|
|
2382
|
+
* @param {string} data_contract_id
|
|
2383
|
+
* @param {string} document_type
|
|
2384
|
+
* @param {string} document_id
|
|
2385
|
+
* @param {string} owner_id
|
|
2386
|
+
* @param {string} recipient_id
|
|
2387
|
+
* @param {string} private_key_wif
|
|
2388
|
+
* @returns {Promise<any>}
|
|
2389
|
+
*/
|
|
2390
|
+
documentTransfer(data_contract_id, document_type, document_id, owner_id, recipient_id, private_key_wif) {
|
|
2391
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2392
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2393
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2394
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2395
|
+
const ptr2 = passStringToWasm0(document_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2396
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2397
|
+
const ptr3 = passStringToWasm0(owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2398
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2399
|
+
const ptr4 = passStringToWasm0(recipient_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2400
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2401
|
+
const ptr5 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2402
|
+
const len5 = WASM_VECTOR_LEN;
|
|
2403
|
+
const ret = wasm.wasmsdk_documentTransfer(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
2404
|
+
return ret;
|
|
2405
|
+
}
|
|
2406
|
+
/**
|
|
2407
|
+
* Purchase a document that has a price set.
|
|
2408
|
+
*
|
|
2409
|
+
* # Arguments
|
|
2410
|
+
*
|
|
2411
|
+
* * `data_contract_id` - The ID of the data contract
|
|
2412
|
+
* * `document_type` - The name of the document type
|
|
2413
|
+
* * `document_id` - The ID of the document to purchase
|
|
2414
|
+
* * `buyer_id` - The buyer's identity ID
|
|
2415
|
+
* * `price` - The purchase price in credits
|
|
2416
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2417
|
+
*
|
|
2418
|
+
* # Returns
|
|
2419
|
+
*
|
|
2420
|
+
* Returns a Promise that resolves to a JsValue containing the purchase result
|
|
2421
|
+
* @param {string} data_contract_id
|
|
2422
|
+
* @param {string} document_type
|
|
2423
|
+
* @param {string} document_id
|
|
2424
|
+
* @param {string} buyer_id
|
|
2425
|
+
* @param {bigint} price
|
|
2426
|
+
* @param {string} private_key_wif
|
|
2427
|
+
* @returns {Promise<any>}
|
|
2428
|
+
*/
|
|
2429
|
+
documentPurchase(data_contract_id, document_type, document_id, buyer_id, price, private_key_wif) {
|
|
2430
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2431
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2432
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2433
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2434
|
+
const ptr2 = passStringToWasm0(document_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2435
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2436
|
+
const ptr3 = passStringToWasm0(buyer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2437
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2438
|
+
const ptr4 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2439
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2440
|
+
const ret = wasm.wasmsdk_documentPurchase(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, price, ptr4, len4);
|
|
2441
|
+
return ret;
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* Set a price for a document to enable purchases.
|
|
2445
|
+
*
|
|
2446
|
+
* # Arguments
|
|
2447
|
+
*
|
|
2448
|
+
* * `data_contract_id` - The ID of the data contract
|
|
2449
|
+
* * `document_type` - The name of the document type
|
|
2450
|
+
* * `document_id` - The ID of the document
|
|
2451
|
+
* * `owner_id` - The owner's identity ID
|
|
2452
|
+
* * `price` - The price in credits (0 to remove price)
|
|
2453
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2454
|
+
*
|
|
2455
|
+
* # Returns
|
|
2456
|
+
*
|
|
2457
|
+
* Returns a Promise that resolves to a JsValue containing the result
|
|
2458
|
+
* @param {string} data_contract_id
|
|
2459
|
+
* @param {string} document_type
|
|
2460
|
+
* @param {string} document_id
|
|
2461
|
+
* @param {string} owner_id
|
|
2462
|
+
* @param {bigint} price
|
|
2463
|
+
* @param {string} private_key_wif
|
|
2464
|
+
* @returns {Promise<any>}
|
|
2465
|
+
*/
|
|
2466
|
+
documentSetPrice(data_contract_id, document_type, document_id, owner_id, price, private_key_wif) {
|
|
2467
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2468
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2469
|
+
const ptr1 = passStringToWasm0(document_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2470
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2471
|
+
const ptr2 = passStringToWasm0(document_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2472
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2473
|
+
const ptr3 = passStringToWasm0(owner_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2474
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2475
|
+
const ptr4 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2476
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2477
|
+
const ret = wasm.wasmsdk_documentSetPrice(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, price, ptr4, len4);
|
|
2478
|
+
return ret;
|
|
2479
|
+
}
|
|
2480
|
+
/**
|
|
2481
|
+
* Create a new identity on Dash Platform.
|
|
2482
|
+
*
|
|
2483
|
+
* # Arguments
|
|
2484
|
+
*
|
|
2485
|
+
* * `asset_lock_proof` - The asset lock proof (transaction hex)
|
|
2486
|
+
* * `asset_lock_proof_private_key` - The private key that controls the asset lock
|
|
2487
|
+
* * `public_keys` - JSON array of public keys to add to the identity. Each key object requirements:
|
|
2488
|
+
* - ECDSA_SECP256K1: Requires `privateKeyHex` or `privateKeyWif` for signing
|
|
2489
|
+
* - BLS12_381: Requires `privateKeyHex` for signing (WIF format not supported)
|
|
2490
|
+
* - ECDSA_HASH160: Accepts either `privateKeyHex` (to derive hash) or `data` field (base64-encoded 20-byte hash)
|
|
2491
|
+
*
|
|
2492
|
+
* # Implementation Notes
|
|
2493
|
+
*
|
|
2494
|
+
* This function uses SimpleSigner to provide individual signatures for each public key as required.
|
|
2495
|
+
* Each ECDSA_SECP256K1 key will be signed with its corresponding private key (from privateKeyHex or privateKeyWif),
|
|
2496
|
+
* and each BLS12_381 key will be signed with its corresponding private key (from privateKeyHex only),
|
|
2497
|
+
* ensuring unique signatures per key as required by DPP validation.
|
|
2498
|
+
*
|
|
2499
|
+
* # Returns
|
|
2500
|
+
*
|
|
2501
|
+
* Returns a Promise that resolves to a JsValue containing the new identity
|
|
2502
|
+
* @param {string} asset_lock_proof
|
|
2503
|
+
* @param {string} asset_lock_proof_private_key
|
|
2504
|
+
* @param {string} public_keys
|
|
2505
|
+
* @returns {Promise<any>}
|
|
2506
|
+
*/
|
|
2507
|
+
identityCreate(asset_lock_proof, asset_lock_proof_private_key, public_keys) {
|
|
2508
|
+
const ptr0 = passStringToWasm0(asset_lock_proof, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2509
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2510
|
+
const ptr1 = passStringToWasm0(asset_lock_proof_private_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2511
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2512
|
+
const ptr2 = passStringToWasm0(public_keys, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2513
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2514
|
+
const ret = wasm.wasmsdk_identityCreate(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
2515
|
+
return ret;
|
|
2516
|
+
}
|
|
2517
|
+
/**
|
|
2518
|
+
* Top up an existing identity with additional credits.
|
|
2519
|
+
*
|
|
2520
|
+
* # Arguments
|
|
2521
|
+
*
|
|
2522
|
+
* * `identity_id` - The identity ID to top up
|
|
2523
|
+
* * `asset_lock_proof` - The asset lock proof (transaction hex)
|
|
2524
|
+
* * `asset_lock_proof_private_key` - The private key that controls the asset lock
|
|
2525
|
+
*
|
|
2526
|
+
* # Returns
|
|
2527
|
+
*
|
|
2528
|
+
* Returns a Promise that resolves to a JsValue containing the new balance
|
|
2529
|
+
* @param {string} identity_id
|
|
2530
|
+
* @param {string} asset_lock_proof
|
|
2531
|
+
* @param {string} asset_lock_proof_private_key
|
|
2532
|
+
* @returns {Promise<any>}
|
|
2533
|
+
*/
|
|
2534
|
+
identityTopUp(identity_id, asset_lock_proof, asset_lock_proof_private_key) {
|
|
2535
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2536
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2537
|
+
const ptr1 = passStringToWasm0(asset_lock_proof, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2538
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2539
|
+
const ptr2 = passStringToWasm0(asset_lock_proof_private_key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2540
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2541
|
+
const ret = wasm.wasmsdk_identityTopUp(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
2542
|
+
return ret;
|
|
2543
|
+
}
|
|
2544
|
+
/**
|
|
2545
|
+
* Transfer credits from one identity to another.
|
|
2546
|
+
*
|
|
2547
|
+
* # Arguments
|
|
2548
|
+
*
|
|
2549
|
+
* * `sender_id` - The identity ID of the sender
|
|
2550
|
+
* * `recipient_id` - The identity ID of the recipient
|
|
2551
|
+
* * `amount` - The amount of credits to transfer
|
|
2552
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2553
|
+
* * `key_id` - Optional key ID to use for signing (if None, will auto-select)
|
|
2554
|
+
*
|
|
2555
|
+
* # Returns
|
|
2556
|
+
*
|
|
2557
|
+
* Returns a Promise that resolves to a JsValue containing the transfer result
|
|
2558
|
+
* @param {string} sender_id
|
|
2559
|
+
* @param {string} recipient_id
|
|
2560
|
+
* @param {bigint} amount
|
|
2561
|
+
* @param {string} private_key_wif
|
|
2562
|
+
* @param {number | null} [key_id]
|
|
2563
|
+
* @returns {Promise<any>}
|
|
2564
|
+
*/
|
|
2565
|
+
identityCreditTransfer(sender_id, recipient_id, amount, private_key_wif, key_id) {
|
|
2566
|
+
const ptr0 = passStringToWasm0(sender_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2567
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2568
|
+
const ptr1 = passStringToWasm0(recipient_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2569
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2570
|
+
const ptr2 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2571
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2572
|
+
const ret = wasm.wasmsdk_identityCreditTransfer(this.__wbg_ptr, ptr0, len0, ptr1, len1, amount, ptr2, len2, isLikeNone(key_id) ? 0x100000001 : (key_id) >>> 0);
|
|
2573
|
+
return ret;
|
|
2574
|
+
}
|
|
2575
|
+
/**
|
|
2576
|
+
* Withdraw credits from an identity to a Dash address.
|
|
2577
|
+
*
|
|
2578
|
+
* # Arguments
|
|
2579
|
+
*
|
|
2580
|
+
* * `identity_id` - The identity ID to withdraw from
|
|
2581
|
+
* * `to_address` - The Dash address to send the withdrawn credits to
|
|
2582
|
+
* * `amount` - The amount of credits to withdraw
|
|
2583
|
+
* * `core_fee_per_byte` - Optional core fee per byte (defaults to 1)
|
|
2584
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2585
|
+
* * `key_id` - Optional key ID to use for signing (if None, will auto-select)
|
|
2586
|
+
*
|
|
2587
|
+
* # Returns
|
|
2588
|
+
*
|
|
2589
|
+
* Returns a Promise that resolves to a JsValue containing the withdrawal result
|
|
2590
|
+
* @param {string} identity_id
|
|
2591
|
+
* @param {string} to_address
|
|
2592
|
+
* @param {bigint} amount
|
|
2593
|
+
* @param {number | null | undefined} core_fee_per_byte
|
|
2594
|
+
* @param {string} private_key_wif
|
|
2595
|
+
* @param {number | null} [key_id]
|
|
2596
|
+
* @returns {Promise<any>}
|
|
2597
|
+
*/
|
|
2598
|
+
identityCreditWithdrawal(identity_id, to_address, amount, core_fee_per_byte, private_key_wif, key_id) {
|
|
2599
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2600
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2601
|
+
const ptr1 = passStringToWasm0(to_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2602
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2603
|
+
const ptr2 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2604
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2605
|
+
const ret = wasm.wasmsdk_identityCreditWithdrawal(this.__wbg_ptr, ptr0, len0, ptr1, len1, amount, isLikeNone(core_fee_per_byte) ? 0x100000001 : (core_fee_per_byte) >>> 0, ptr2, len2, isLikeNone(key_id) ? 0x100000001 : (key_id) >>> 0);
|
|
2606
|
+
return ret;
|
|
2607
|
+
}
|
|
2608
|
+
/**
|
|
2609
|
+
* Update an identity by adding or disabling public keys.
|
|
2610
|
+
*
|
|
2611
|
+
* # Arguments
|
|
2612
|
+
*
|
|
2613
|
+
* * `identity_id` - The identity ID to update
|
|
2614
|
+
* * `add_public_keys` - JSON array of public keys to add
|
|
2615
|
+
* * `disable_public_keys` - Array of key IDs to disable
|
|
2616
|
+
* * `private_key_wif` - The private key in WIF format for signing (must be a master key)
|
|
2617
|
+
*
|
|
2618
|
+
* # Returns
|
|
2619
|
+
*
|
|
2620
|
+
* Returns a Promise that resolves to a JsValue containing the update result
|
|
2621
|
+
* @param {string} identity_id
|
|
2622
|
+
* @param {string | null | undefined} add_public_keys
|
|
2623
|
+
* @param {Uint32Array | null | undefined} disable_public_keys
|
|
2624
|
+
* @param {string} private_key_wif
|
|
2625
|
+
* @returns {Promise<any>}
|
|
2626
|
+
*/
|
|
2627
|
+
identityUpdate(identity_id, add_public_keys, disable_public_keys, private_key_wif) {
|
|
2628
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2629
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2630
|
+
var ptr1 = isLikeNone(add_public_keys) ? 0 : passStringToWasm0(add_public_keys, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2631
|
+
var len1 = WASM_VECTOR_LEN;
|
|
2632
|
+
var ptr2 = isLikeNone(disable_public_keys) ? 0 : passArray32ToWasm0(disable_public_keys, wasm.__wbindgen_malloc);
|
|
2633
|
+
var len2 = WASM_VECTOR_LEN;
|
|
2634
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2635
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2636
|
+
const ret = wasm.wasmsdk_identityUpdate(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
2637
|
+
return ret;
|
|
2638
|
+
}
|
|
2639
|
+
/**
|
|
2640
|
+
* Submit a masternode vote for a contested resource.
|
|
2641
|
+
*
|
|
2642
|
+
* # Arguments
|
|
2643
|
+
*
|
|
2644
|
+
* * `pro_tx_hash` - The ProTxHash of the masternode
|
|
2645
|
+
* * `contract_id` - The data contract ID containing the contested resource
|
|
2646
|
+
* * `document_type_name` - The document type name (e.g., "domain")
|
|
2647
|
+
* * `index_name` - The index name (e.g., "parentNameAndLabel")
|
|
2648
|
+
* * `index_values` - JSON array of index values (e.g., ["dash", "username"])
|
|
2649
|
+
* * `vote_choice` - The vote choice: "towardsIdentity:<identity_id>", "abstain", or "lock"
|
|
2650
|
+
* * `private_key_wif` - The masternode voting key in WIF format
|
|
2651
|
+
*
|
|
2652
|
+
* # Returns
|
|
2653
|
+
*
|
|
2654
|
+
* Returns a Promise that resolves to a JsValue containing the vote result
|
|
2655
|
+
* @param {string} masternode_pro_tx_hash
|
|
2656
|
+
* @param {string} contract_id
|
|
2657
|
+
* @param {string} document_type_name
|
|
2658
|
+
* @param {string} index_name
|
|
2659
|
+
* @param {string} index_values
|
|
2660
|
+
* @param {string} vote_choice
|
|
2661
|
+
* @param {string} voting_key_wif
|
|
2662
|
+
* @returns {Promise<any>}
|
|
2663
|
+
*/
|
|
2664
|
+
masternodeVote(masternode_pro_tx_hash, contract_id, document_type_name, index_name, index_values, vote_choice, voting_key_wif) {
|
|
2665
|
+
const ptr0 = passStringToWasm0(masternode_pro_tx_hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2666
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2667
|
+
const ptr1 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2668
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2669
|
+
const ptr2 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2670
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2671
|
+
const ptr3 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2672
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2673
|
+
const ptr4 = passStringToWasm0(index_values, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2674
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2675
|
+
const ptr5 = passStringToWasm0(vote_choice, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2676
|
+
const len5 = WASM_VECTOR_LEN;
|
|
2677
|
+
const ptr6 = passStringToWasm0(voting_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2678
|
+
const len6 = WASM_VECTOR_LEN;
|
|
2679
|
+
const ret = wasm.wasmsdk_masternodeVote(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
2680
|
+
return ret;
|
|
2681
|
+
}
|
|
2682
|
+
/**
|
|
2683
|
+
* Mint new tokens according to the token's configuration.
|
|
2684
|
+
*
|
|
2685
|
+
* # Arguments
|
|
2686
|
+
*
|
|
2687
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2688
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2689
|
+
* * `amount` - The amount of tokens to mint
|
|
2690
|
+
* * `identity_id` - The identity ID of the minter
|
|
2691
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2692
|
+
* * `recipient_id` - Optional recipient identity ID (if None, mints to issuer)
|
|
2693
|
+
* * `public_note` - Optional public note for the mint operation
|
|
2694
|
+
*
|
|
2695
|
+
* # Returns
|
|
2696
|
+
*
|
|
2697
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2698
|
+
* @param {string} data_contract_id
|
|
2699
|
+
* @param {number} token_position
|
|
2700
|
+
* @param {string} amount
|
|
2701
|
+
* @param {string} identity_id
|
|
2702
|
+
* @param {string} private_key_wif
|
|
2703
|
+
* @param {string | null} [recipient_id]
|
|
2704
|
+
* @param {string | null} [public_note]
|
|
2705
|
+
* @returns {Promise<any>}
|
|
2706
|
+
*/
|
|
2707
|
+
tokenMint(data_contract_id, token_position, amount, identity_id, private_key_wif, recipient_id, public_note) {
|
|
2708
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2709
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2710
|
+
const ptr1 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2711
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2712
|
+
const ptr2 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2713
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2714
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2715
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2716
|
+
var ptr4 = isLikeNone(recipient_id) ? 0 : passStringToWasm0(recipient_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2717
|
+
var len4 = WASM_VECTOR_LEN;
|
|
2718
|
+
var ptr5 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2719
|
+
var len5 = WASM_VECTOR_LEN;
|
|
2720
|
+
const ret = wasm.wasmsdk_tokenMint(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
2721
|
+
return ret;
|
|
2722
|
+
}
|
|
2723
|
+
/**
|
|
2724
|
+
* Burn tokens, permanently removing them from circulation.
|
|
2725
|
+
*
|
|
2726
|
+
* # Arguments
|
|
2727
|
+
*
|
|
2728
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2729
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2730
|
+
* * `amount` - The amount of tokens to burn
|
|
2731
|
+
* * `identity_id` - The identity ID of the burner
|
|
2732
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2733
|
+
* * `public_note` - Optional public note for the burn operation
|
|
2734
|
+
*
|
|
2735
|
+
* # Returns
|
|
2736
|
+
*
|
|
2737
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2738
|
+
* @param {string} data_contract_id
|
|
2739
|
+
* @param {number} token_position
|
|
2740
|
+
* @param {string} amount
|
|
2741
|
+
* @param {string} identity_id
|
|
2742
|
+
* @param {string} private_key_wif
|
|
2743
|
+
* @param {string | null} [public_note]
|
|
2744
|
+
* @returns {Promise<any>}
|
|
2745
|
+
*/
|
|
2746
|
+
tokenBurn(data_contract_id, token_position, amount, identity_id, private_key_wif, public_note) {
|
|
2747
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2748
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2749
|
+
const ptr1 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2750
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2751
|
+
const ptr2 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2752
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2753
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2754
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2755
|
+
var ptr4 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2756
|
+
var len4 = WASM_VECTOR_LEN;
|
|
2757
|
+
const ret = wasm.wasmsdk_tokenBurn(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
2758
|
+
return ret;
|
|
2759
|
+
}
|
|
2760
|
+
/**
|
|
2761
|
+
* Transfer tokens between identities.
|
|
2762
|
+
*
|
|
2763
|
+
* # Arguments
|
|
2764
|
+
*
|
|
2765
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2766
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2767
|
+
* * `amount` - The amount of tokens to transfer
|
|
2768
|
+
* * `sender_id` - The identity ID of the sender
|
|
2769
|
+
* * `recipient_id` - The identity ID of the recipient
|
|
2770
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2771
|
+
* * `public_note` - Optional public note for the transfer
|
|
2772
|
+
*
|
|
2773
|
+
* # Returns
|
|
2774
|
+
*
|
|
2775
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2776
|
+
* @param {string} data_contract_id
|
|
2777
|
+
* @param {number} token_position
|
|
2778
|
+
* @param {string} amount
|
|
2779
|
+
* @param {string} sender_id
|
|
2780
|
+
* @param {string} recipient_id
|
|
2781
|
+
* @param {string} private_key_wif
|
|
2782
|
+
* @param {string | null} [public_note]
|
|
2783
|
+
* @returns {Promise<any>}
|
|
2784
|
+
*/
|
|
2785
|
+
tokenTransfer(data_contract_id, token_position, amount, sender_id, recipient_id, private_key_wif, public_note) {
|
|
2786
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2787
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2788
|
+
const ptr1 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2789
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2790
|
+
const ptr2 = passStringToWasm0(sender_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2791
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2792
|
+
const ptr3 = passStringToWasm0(recipient_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2793
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2794
|
+
const ptr4 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2795
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2796
|
+
var ptr5 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2797
|
+
var len5 = WASM_VECTOR_LEN;
|
|
2798
|
+
const ret = wasm.wasmsdk_tokenTransfer(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
2799
|
+
return ret;
|
|
2800
|
+
}
|
|
2801
|
+
/**
|
|
2802
|
+
* Freeze tokens for a specific identity.
|
|
2803
|
+
*
|
|
2804
|
+
* # Arguments
|
|
2805
|
+
*
|
|
2806
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2807
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2808
|
+
* * `identity_to_freeze` - The identity ID whose tokens to freeze
|
|
2809
|
+
* * `freezer_id` - The identity ID of the freezer (must have permission)
|
|
2810
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2811
|
+
* * `public_note` - Optional public note for the freeze operation
|
|
2812
|
+
*
|
|
2813
|
+
* # Returns
|
|
2814
|
+
*
|
|
2815
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2816
|
+
* @param {string} data_contract_id
|
|
2817
|
+
* @param {number} token_position
|
|
2818
|
+
* @param {string} identity_to_freeze
|
|
2819
|
+
* @param {string} freezer_id
|
|
2820
|
+
* @param {string} private_key_wif
|
|
2821
|
+
* @param {string | null} [public_note]
|
|
2822
|
+
* @returns {Promise<any>}
|
|
2823
|
+
*/
|
|
2824
|
+
tokenFreeze(data_contract_id, token_position, identity_to_freeze, freezer_id, private_key_wif, public_note) {
|
|
2825
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2826
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2827
|
+
const ptr1 = passStringToWasm0(identity_to_freeze, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2828
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2829
|
+
const ptr2 = passStringToWasm0(freezer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2830
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2831
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2832
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2833
|
+
var ptr4 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2834
|
+
var len4 = WASM_VECTOR_LEN;
|
|
2835
|
+
const ret = wasm.wasmsdk_tokenFreeze(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
2836
|
+
return ret;
|
|
2837
|
+
}
|
|
2838
|
+
/**
|
|
2839
|
+
* Unfreeze tokens for a specific identity.
|
|
2840
|
+
*
|
|
2841
|
+
* # Arguments
|
|
2842
|
+
*
|
|
2843
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2844
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2845
|
+
* * `identity_to_unfreeze` - The identity ID whose tokens to unfreeze
|
|
2846
|
+
* * `unfreezer_id` - The identity ID of the unfreezer (must have permission)
|
|
2847
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2848
|
+
* * `public_note` - Optional public note for the unfreeze operation
|
|
2849
|
+
*
|
|
2850
|
+
* # Returns
|
|
2851
|
+
*
|
|
2852
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2853
|
+
* @param {string} data_contract_id
|
|
2854
|
+
* @param {number} token_position
|
|
2855
|
+
* @param {string} identity_to_unfreeze
|
|
2856
|
+
* @param {string} unfreezer_id
|
|
2857
|
+
* @param {string} private_key_wif
|
|
2858
|
+
* @param {string | null} [public_note]
|
|
2859
|
+
* @returns {Promise<any>}
|
|
2860
|
+
*/
|
|
2861
|
+
tokenUnfreeze(data_contract_id, token_position, identity_to_unfreeze, unfreezer_id, private_key_wif, public_note) {
|
|
2862
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2863
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2864
|
+
const ptr1 = passStringToWasm0(identity_to_unfreeze, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2865
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2866
|
+
const ptr2 = passStringToWasm0(unfreezer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2867
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2868
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2869
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2870
|
+
var ptr4 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2871
|
+
var len4 = WASM_VECTOR_LEN;
|
|
2872
|
+
const ret = wasm.wasmsdk_tokenUnfreeze(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
2873
|
+
return ret;
|
|
2874
|
+
}
|
|
2875
|
+
/**
|
|
2876
|
+
* Destroy frozen tokens.
|
|
2877
|
+
*
|
|
2878
|
+
* # Arguments
|
|
2879
|
+
*
|
|
2880
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2881
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2882
|
+
* * `identity_id` - The identity ID whose frozen tokens to destroy
|
|
2883
|
+
* * `destroyer_id` - The identity ID of the destroyer (must have permission)
|
|
2884
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2885
|
+
* * `public_note` - Optional public note for the destroy operation
|
|
2886
|
+
*
|
|
2887
|
+
* # Returns
|
|
2888
|
+
*
|
|
2889
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2890
|
+
* @param {string} data_contract_id
|
|
2891
|
+
* @param {number} token_position
|
|
2892
|
+
* @param {string} identity_id
|
|
2893
|
+
* @param {string} destroyer_id
|
|
2894
|
+
* @param {string} private_key_wif
|
|
2895
|
+
* @param {string | null} [public_note]
|
|
2896
|
+
* @returns {Promise<any>}
|
|
2897
|
+
*/
|
|
2898
|
+
tokenDestroyFrozen(data_contract_id, token_position, identity_id, destroyer_id, private_key_wif, public_note) {
|
|
2899
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2900
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2901
|
+
const ptr1 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2902
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2903
|
+
const ptr2 = passStringToWasm0(destroyer_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2904
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2905
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2906
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2907
|
+
var ptr4 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2908
|
+
var len4 = WASM_VECTOR_LEN;
|
|
2909
|
+
const ret = wasm.wasmsdk_tokenDestroyFrozen(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
2910
|
+
return ret;
|
|
2911
|
+
}
|
|
2912
|
+
/**
|
|
2913
|
+
* Set or update the price for direct token purchases.
|
|
2914
|
+
*
|
|
2915
|
+
* # Arguments
|
|
2916
|
+
*
|
|
2917
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2918
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2919
|
+
* * `identity_id` - The identity ID of the actor setting the price
|
|
2920
|
+
* * `price_type` - The pricing type: "single" or "tiered"
|
|
2921
|
+
* * `price_data` - JSON string with pricing data (single price or tiered pricing map)
|
|
2922
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2923
|
+
* * `key_id` - The key ID to use for signing
|
|
2924
|
+
* * `public_note` - Optional public note for the price change
|
|
2925
|
+
*
|
|
2926
|
+
* # Returns
|
|
2927
|
+
*
|
|
2928
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2929
|
+
* @param {string} data_contract_id
|
|
2930
|
+
* @param {number} token_position
|
|
2931
|
+
* @param {string} identity_id
|
|
2932
|
+
* @param {string} price_type
|
|
2933
|
+
* @param {string} price_data
|
|
2934
|
+
* @param {string} private_key_wif
|
|
2935
|
+
* @param {string | null} [public_note]
|
|
2936
|
+
* @returns {Promise<any>}
|
|
2937
|
+
*/
|
|
2938
|
+
tokenSetPriceForDirectPurchase(data_contract_id, token_position, identity_id, price_type, price_data, private_key_wif, public_note) {
|
|
2939
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2940
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2941
|
+
const ptr1 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2942
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2943
|
+
const ptr2 = passStringToWasm0(price_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2944
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2945
|
+
const ptr3 = passStringToWasm0(price_data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2946
|
+
const len3 = WASM_VECTOR_LEN;
|
|
2947
|
+
const ptr4 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2948
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2949
|
+
var ptr5 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2950
|
+
var len5 = WASM_VECTOR_LEN;
|
|
2951
|
+
const ret = wasm.wasmsdk_tokenSetPriceForDirectPurchase(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
2952
|
+
return ret;
|
|
2953
|
+
}
|
|
2954
|
+
/**
|
|
2955
|
+
* Purchase tokens directly at the configured price.
|
|
2956
|
+
*
|
|
2957
|
+
* # Arguments
|
|
2958
|
+
*
|
|
2959
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
2960
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
2961
|
+
* * `amount` - The amount of tokens to purchase
|
|
2962
|
+
* * `identity_id` - The identity ID of the purchaser
|
|
2963
|
+
* * `total_agreed_price` - The total price in credits for the purchase
|
|
2964
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
2965
|
+
*
|
|
2966
|
+
* # Returns
|
|
2967
|
+
*
|
|
2968
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
2969
|
+
* @param {string} data_contract_id
|
|
2970
|
+
* @param {number} token_position
|
|
2971
|
+
* @param {string} amount
|
|
2972
|
+
* @param {string} identity_id
|
|
2973
|
+
* @param {string | null | undefined} total_agreed_price
|
|
2974
|
+
* @param {string} private_key_wif
|
|
2975
|
+
* @returns {Promise<any>}
|
|
2976
|
+
*/
|
|
2977
|
+
tokenDirectPurchase(data_contract_id, token_position, amount, identity_id, total_agreed_price, private_key_wif) {
|
|
2978
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2979
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2980
|
+
const ptr1 = passStringToWasm0(amount, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2981
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2982
|
+
const ptr2 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2983
|
+
const len2 = WASM_VECTOR_LEN;
|
|
2984
|
+
var ptr3 = isLikeNone(total_agreed_price) ? 0 : passStringToWasm0(total_agreed_price, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2985
|
+
var len3 = WASM_VECTOR_LEN;
|
|
2986
|
+
const ptr4 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2987
|
+
const len4 = WASM_VECTOR_LEN;
|
|
2988
|
+
const ret = wasm.wasmsdk_tokenDirectPurchase(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
2989
|
+
return ret;
|
|
2990
|
+
}
|
|
2991
|
+
/**
|
|
2992
|
+
* Claim tokens from a distribution
|
|
2993
|
+
*
|
|
2994
|
+
* # Arguments
|
|
2995
|
+
*
|
|
2996
|
+
* * `data_contract_id` - ID of the data contract containing the token
|
|
2997
|
+
* * `token_position` - Position of the token within the contract
|
|
2998
|
+
* * `distribution_type` - Type of distribution: "perpetual" or "preprogrammed"
|
|
2999
|
+
* * `identity_id` - Identity ID of the claimant
|
|
3000
|
+
* * `private_key_wif` - Private key in WIF format
|
|
3001
|
+
* * `public_note` - Optional public note
|
|
3002
|
+
*
|
|
3003
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
3004
|
+
* @param {string} data_contract_id
|
|
3005
|
+
* @param {number} token_position
|
|
3006
|
+
* @param {string} distribution_type
|
|
3007
|
+
* @param {string} identity_id
|
|
3008
|
+
* @param {string} private_key_wif
|
|
3009
|
+
* @param {string | null} [public_note]
|
|
3010
|
+
* @returns {Promise<any>}
|
|
3011
|
+
*/
|
|
3012
|
+
tokenClaim(data_contract_id, token_position, distribution_type, identity_id, private_key_wif, public_note) {
|
|
3013
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3014
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3015
|
+
const ptr1 = passStringToWasm0(distribution_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3016
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3017
|
+
const ptr2 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3018
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3019
|
+
const ptr3 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3020
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3021
|
+
var ptr4 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3022
|
+
var len4 = WASM_VECTOR_LEN;
|
|
3023
|
+
const ret = wasm.wasmsdk_tokenClaim(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
3024
|
+
return ret;
|
|
3025
|
+
}
|
|
3026
|
+
/**
|
|
3027
|
+
* Update token configuration settings.
|
|
3028
|
+
*
|
|
3029
|
+
* # Arguments
|
|
3030
|
+
*
|
|
3031
|
+
* * `data_contract_id` - The ID of the data contract containing the token
|
|
3032
|
+
* * `token_position` - The position of the token in the contract (0-indexed)
|
|
3033
|
+
* * `config_item_type` - The type of configuration to update
|
|
3034
|
+
* * `config_value` - The new configuration value (JSON string)
|
|
3035
|
+
* * `identity_id` - The identity ID of the owner/admin
|
|
3036
|
+
* * `private_key_wif` - The private key in WIF format for signing
|
|
3037
|
+
* * `public_note` - Optional public note for the configuration change
|
|
3038
|
+
*
|
|
3039
|
+
* # Returns
|
|
3040
|
+
*
|
|
3041
|
+
* Returns a Promise that resolves to a JsValue containing the state transition result
|
|
3042
|
+
* @param {string} data_contract_id
|
|
3043
|
+
* @param {number} token_position
|
|
3044
|
+
* @param {string} config_item_type
|
|
3045
|
+
* @param {string} config_value
|
|
3046
|
+
* @param {string} identity_id
|
|
3047
|
+
* @param {string} private_key_wif
|
|
3048
|
+
* @param {string | null} [public_note]
|
|
3049
|
+
* @returns {Promise<any>}
|
|
3050
|
+
*/
|
|
3051
|
+
tokenConfigUpdate(data_contract_id, token_position, config_item_type, config_value, identity_id, private_key_wif, public_note) {
|
|
3052
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3053
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3054
|
+
const ptr1 = passStringToWasm0(config_item_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3055
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3056
|
+
const ptr2 = passStringToWasm0(config_value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3057
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3058
|
+
const ptr3 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3059
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3060
|
+
const ptr4 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3061
|
+
const len4 = WASM_VECTOR_LEN;
|
|
3062
|
+
var ptr5 = isLikeNone(public_note) ? 0 : passStringToWasm0(public_note, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3063
|
+
var len5 = WASM_VECTOR_LEN;
|
|
3064
|
+
const ret = wasm.wasmsdk_tokenConfigUpdate(this.__wbg_ptr, ptr0, len0, token_position, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
3065
|
+
return ret;
|
|
3066
|
+
}
|
|
3067
|
+
/**
|
|
3068
|
+
* Derive a key from seed phrase with extended path supporting 256-bit indices
|
|
3069
|
+
* This supports DIP14/DIP15 paths with identity IDs
|
|
3070
|
+
* @param {string} mnemonic
|
|
3071
|
+
* @param {string | null | undefined} passphrase
|
|
3072
|
+
* @param {string} path
|
|
3073
|
+
* @param {string} network
|
|
3074
|
+
* @returns {any}
|
|
3075
|
+
*/
|
|
3076
|
+
static deriveKeyFromSeedWithExtendedPath(mnemonic, passphrase, path, network) {
|
|
3077
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3078
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3079
|
+
var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3080
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3081
|
+
const ptr2 = passStringToWasm0(path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3082
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3083
|
+
const ptr3 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3084
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3085
|
+
const ret = wasm.wasmsdk_deriveKeyFromSeedWithExtendedPath(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
3086
|
+
if (ret[2]) {
|
|
3087
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3088
|
+
}
|
|
3089
|
+
return takeFromExternrefTable0(ret[0]);
|
|
3090
|
+
}
|
|
3091
|
+
/**
|
|
3092
|
+
* Derive a DashPay contact key using DIP15 with full identity IDs
|
|
3093
|
+
* @param {string} mnemonic
|
|
3094
|
+
* @param {string | null | undefined} passphrase
|
|
3095
|
+
* @param {string} sender_identity_id
|
|
3096
|
+
* @param {string} receiver_identity_id
|
|
3097
|
+
* @param {number} account
|
|
3098
|
+
* @param {number} address_index
|
|
3099
|
+
* @param {string} network
|
|
3100
|
+
* @returns {any}
|
|
3101
|
+
*/
|
|
3102
|
+
static deriveDashpayContactKey(mnemonic, passphrase, sender_identity_id, receiver_identity_id, account, address_index, network) {
|
|
3103
|
+
const ptr0 = passStringToWasm0(mnemonic, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3104
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3105
|
+
var ptr1 = isLikeNone(passphrase) ? 0 : passStringToWasm0(passphrase, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3106
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3107
|
+
const ptr2 = passStringToWasm0(sender_identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3108
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3109
|
+
const ptr3 = passStringToWasm0(receiver_identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3110
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3111
|
+
const ptr4 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3112
|
+
const len4 = WASM_VECTOR_LEN;
|
|
3113
|
+
const ret = wasm.wasmsdk_deriveDashpayContactKey(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, account, address_index, ptr4, len4);
|
|
3114
|
+
if (ret[2]) {
|
|
3115
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3116
|
+
}
|
|
3117
|
+
return takeFromExternrefTable0(ret[0]);
|
|
3118
|
+
}
|
|
3119
|
+
/**
|
|
3120
|
+
* Convert a string to homograph-safe characters
|
|
3121
|
+
* @param {string} input
|
|
3122
|
+
* @returns {string}
|
|
3123
|
+
*/
|
|
3124
|
+
static dpnsConvertToHomographSafe(input) {
|
|
3125
|
+
let deferred2_0;
|
|
3126
|
+
let deferred2_1;
|
|
3127
|
+
try {
|
|
3128
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3129
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3130
|
+
const ret = wasm.wasmsdk_dpnsConvertToHomographSafe(ptr0, len0);
|
|
3131
|
+
deferred2_0 = ret[0];
|
|
3132
|
+
deferred2_1 = ret[1];
|
|
3133
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3134
|
+
} finally {
|
|
3135
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
3136
|
+
}
|
|
3137
|
+
}
|
|
3138
|
+
/**
|
|
3139
|
+
* Check if a username is valid according to DPNS rules
|
|
3140
|
+
* @param {string} label
|
|
3141
|
+
* @returns {boolean}
|
|
3142
|
+
*/
|
|
3143
|
+
static dpnsIsValidUsername(label) {
|
|
3144
|
+
const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3145
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3146
|
+
const ret = wasm.wasmsdk_dpnsIsValidUsername(ptr0, len0);
|
|
3147
|
+
return ret !== 0;
|
|
3148
|
+
}
|
|
3149
|
+
/**
|
|
3150
|
+
* Check if a username is contested (requires masternode voting)
|
|
3151
|
+
* @param {string} label
|
|
3152
|
+
* @returns {boolean}
|
|
3153
|
+
*/
|
|
3154
|
+
static dpnsIsContestedUsername(label) {
|
|
3155
|
+
const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3156
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3157
|
+
const ret = wasm.wasmsdk_dpnsIsContestedUsername(ptr0, len0);
|
|
3158
|
+
return ret !== 0;
|
|
3159
|
+
}
|
|
3160
|
+
/**
|
|
3161
|
+
* Register a DPNS username
|
|
3162
|
+
* @param {string} label
|
|
3163
|
+
* @param {string} identity_id
|
|
3164
|
+
* @param {number} public_key_id
|
|
3165
|
+
* @param {string} private_key_wif
|
|
3166
|
+
* @param {Function | null} [preorder_callback]
|
|
3167
|
+
* @returns {Promise<any>}
|
|
3168
|
+
*/
|
|
3169
|
+
dpnsRegisterName(label, identity_id, public_key_id, private_key_wif, preorder_callback) {
|
|
3170
|
+
const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3171
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3172
|
+
const ptr1 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3173
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3174
|
+
const ptr2 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3175
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3176
|
+
const ret = wasm.wasmsdk_dpnsRegisterName(this.__wbg_ptr, ptr0, len0, ptr1, len1, public_key_id, ptr2, len2, isLikeNone(preorder_callback) ? 0 : addToExternrefTable0(preorder_callback));
|
|
3177
|
+
return ret;
|
|
3178
|
+
}
|
|
3179
|
+
/**
|
|
3180
|
+
* Check if a DPNS name is available
|
|
3181
|
+
* @param {string} label
|
|
3182
|
+
* @returns {Promise<boolean>}
|
|
3183
|
+
*/
|
|
3184
|
+
dpnsIsNameAvailable(label) {
|
|
3185
|
+
const ptr0 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3186
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3187
|
+
const ret = wasm.wasmsdk_dpnsIsNameAvailable(this.__wbg_ptr, ptr0, len0);
|
|
3188
|
+
return ret;
|
|
3189
|
+
}
|
|
3190
|
+
/**
|
|
3191
|
+
* Resolve a DPNS name to an identity ID
|
|
3192
|
+
* @param {string} name
|
|
3193
|
+
* @returns {Promise<any>}
|
|
3194
|
+
*/
|
|
3195
|
+
dpnsResolveName(name) {
|
|
3196
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3197
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3198
|
+
const ret = wasm.wasmsdk_dpnsResolveName(this.__wbg_ptr, ptr0, len0);
|
|
3199
|
+
return ret;
|
|
3200
|
+
}
|
|
3201
|
+
/**
|
|
3202
|
+
* @param {string} document_type_name
|
|
3203
|
+
* @param {string} data_contract_id
|
|
3204
|
+
* @param {string} index_name
|
|
3205
|
+
* @param {Uint8Array | null} [start_at_value]
|
|
3206
|
+
* @param {number | null} [limit]
|
|
3207
|
+
* @param {number | null} [_offset]
|
|
3208
|
+
* @param {boolean | null} [order_ascending]
|
|
3209
|
+
* @returns {Promise<any>}
|
|
3210
|
+
*/
|
|
3211
|
+
getContestedResources(document_type_name, data_contract_id, index_name, start_at_value, limit, _offset, order_ascending) {
|
|
3212
|
+
const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3213
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3214
|
+
const ptr1 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3215
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3216
|
+
const ptr2 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3217
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3218
|
+
var ptr3 = isLikeNone(start_at_value) ? 0 : passArray8ToWasm0(start_at_value, wasm.__wbindgen_malloc);
|
|
3219
|
+
var len3 = WASM_VECTOR_LEN;
|
|
3220
|
+
const ret = wasm.wasmsdk_getContestedResources(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(_offset) ? 0x100000001 : (_offset) >>> 0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3221
|
+
return ret;
|
|
3222
|
+
}
|
|
3223
|
+
/**
|
|
3224
|
+
* @param {string} contract_id
|
|
3225
|
+
* @param {string} document_type_name
|
|
3226
|
+
* @param {string} index_name
|
|
3227
|
+
* @param {any[]} index_values
|
|
3228
|
+
* @param {string} contestant_id
|
|
3229
|
+
* @param {string | null} [start_at_voter_info]
|
|
3230
|
+
* @param {number | null} [limit]
|
|
3231
|
+
* @param {boolean | null} [order_ascending]
|
|
3232
|
+
* @returns {Promise<any>}
|
|
3233
|
+
*/
|
|
3234
|
+
getContestedResourceVotersForIdentity(contract_id, document_type_name, index_name, index_values, contestant_id, start_at_voter_info, limit, order_ascending) {
|
|
3235
|
+
const ptr0 = passStringToWasm0(contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3236
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3237
|
+
const ptr1 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3238
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3239
|
+
const ptr2 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3240
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3241
|
+
const ptr3 = passArrayJsValueToWasm0(index_values, wasm.__wbindgen_malloc);
|
|
3242
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3243
|
+
const ptr4 = passStringToWasm0(contestant_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3244
|
+
const len4 = WASM_VECTOR_LEN;
|
|
3245
|
+
var ptr5 = isLikeNone(start_at_voter_info) ? 0 : passStringToWasm0(start_at_voter_info, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3246
|
+
var len5 = WASM_VECTOR_LEN;
|
|
3247
|
+
const ret = wasm.wasmsdk_getContestedResourceVotersForIdentity(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3248
|
+
return ret;
|
|
3249
|
+
}
|
|
3250
|
+
/**
|
|
3251
|
+
* @param {string} identity_id
|
|
3252
|
+
* @param {number | null} [limit]
|
|
3253
|
+
* @param {string | null} [start_at_vote_poll_id_info]
|
|
3254
|
+
* @param {boolean | null} [order_ascending]
|
|
3255
|
+
* @returns {Promise<any>}
|
|
3256
|
+
*/
|
|
3257
|
+
getContestedResourceIdentityVotes(identity_id, limit, start_at_vote_poll_id_info, order_ascending) {
|
|
3258
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3259
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3260
|
+
var ptr1 = isLikeNone(start_at_vote_poll_id_info) ? 0 : passStringToWasm0(start_at_vote_poll_id_info, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3261
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3262
|
+
const ret = wasm.wasmsdk_getContestedResourceIdentityVotes(this.__wbg_ptr, ptr0, len0, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, ptr1, len1, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3263
|
+
return ret;
|
|
3264
|
+
}
|
|
3265
|
+
/**
|
|
3266
|
+
* @param {string | null} [start_time_info]
|
|
3267
|
+
* @param {string | null} [end_time_info]
|
|
3268
|
+
* @param {number | null} [limit]
|
|
3269
|
+
* @param {boolean | null} [order_ascending]
|
|
3270
|
+
* @returns {Promise<any>}
|
|
3271
|
+
*/
|
|
3272
|
+
getVotePollsByEndDate(start_time_info, end_time_info, limit, order_ascending) {
|
|
3273
|
+
var ptr0 = isLikeNone(start_time_info) ? 0 : passStringToWasm0(start_time_info, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3274
|
+
var len0 = WASM_VECTOR_LEN;
|
|
3275
|
+
var ptr1 = isLikeNone(end_time_info) ? 0 : passStringToWasm0(end_time_info, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3276
|
+
var len1 = WASM_VECTOR_LEN;
|
|
3277
|
+
const ret = wasm.wasmsdk_getVotePollsByEndDate(this.__wbg_ptr, ptr0, len0, ptr1, len1, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3278
|
+
return ret;
|
|
3279
|
+
}
|
|
3280
|
+
/**
|
|
3281
|
+
* @param {string} document_type_name
|
|
3282
|
+
* @param {string} data_contract_id
|
|
3283
|
+
* @param {string} index_name
|
|
3284
|
+
* @param {Uint8Array | null} [start_at_value]
|
|
3285
|
+
* @param {number | null} [limit]
|
|
3286
|
+
* @param {number | null} [_offset]
|
|
3287
|
+
* @param {boolean | null} [order_ascending]
|
|
3288
|
+
* @returns {Promise<any>}
|
|
3289
|
+
*/
|
|
3290
|
+
getContestedResourcesWithProofInfo(document_type_name, data_contract_id, index_name, start_at_value, limit, _offset, order_ascending) {
|
|
3291
|
+
const ptr0 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3292
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3293
|
+
const ptr1 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3294
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3295
|
+
const ptr2 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3296
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3297
|
+
var ptr3 = isLikeNone(start_at_value) ? 0 : passArray8ToWasm0(start_at_value, wasm.__wbindgen_malloc);
|
|
3298
|
+
var len3 = WASM_VECTOR_LEN;
|
|
3299
|
+
const ret = wasm.wasmsdk_getContestedResourcesWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(_offset) ? 0x100000001 : (_offset) >>> 0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3300
|
+
return ret;
|
|
3301
|
+
}
|
|
3302
|
+
/**
|
|
3303
|
+
* @param {string} data_contract_id
|
|
3304
|
+
* @param {string} document_type_name
|
|
3305
|
+
* @param {string} index_name
|
|
3306
|
+
* @param {any[]} index_values
|
|
3307
|
+
* @param {string} _result_type
|
|
3308
|
+
* @param {boolean | null} [allow_include_locked_and_abstaining_vote_tally]
|
|
3309
|
+
* @param {string | null} [start_at_identifier_info]
|
|
3310
|
+
* @param {number | null} [count]
|
|
3311
|
+
* @param {boolean | null} [_order_ascending]
|
|
3312
|
+
* @returns {Promise<any>}
|
|
3313
|
+
*/
|
|
3314
|
+
getContestedResourceVoteStateWithProofInfo(data_contract_id, document_type_name, index_name, index_values, _result_type, allow_include_locked_and_abstaining_vote_tally, start_at_identifier_info, count, _order_ascending) {
|
|
3315
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3317
|
+
const ptr1 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3318
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3319
|
+
const ptr2 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3320
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3321
|
+
const ptr3 = passArrayJsValueToWasm0(index_values, wasm.__wbindgen_malloc);
|
|
3322
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3323
|
+
const ptr4 = passStringToWasm0(_result_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3324
|
+
const len4 = WASM_VECTOR_LEN;
|
|
3325
|
+
var ptr5 = isLikeNone(start_at_identifier_info) ? 0 : passStringToWasm0(start_at_identifier_info, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3326
|
+
var len5 = WASM_VECTOR_LEN;
|
|
3327
|
+
const ret = wasm.wasmsdk_getContestedResourceVoteStateWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, isLikeNone(allow_include_locked_and_abstaining_vote_tally) ? 0xFFFFFF : allow_include_locked_and_abstaining_vote_tally ? 1 : 0, ptr5, len5, isLikeNone(count) ? 0x100000001 : (count) >>> 0, isLikeNone(_order_ascending) ? 0xFFFFFF : _order_ascending ? 1 : 0);
|
|
3328
|
+
return ret;
|
|
3329
|
+
}
|
|
3330
|
+
/**
|
|
3331
|
+
* @param {string} data_contract_id
|
|
3332
|
+
* @param {string} document_type_name
|
|
3333
|
+
* @param {string} index_name
|
|
3334
|
+
* @param {any[]} index_values
|
|
3335
|
+
* @param {string} contestant_id
|
|
3336
|
+
* @param {string | null} [start_at_identifier_info]
|
|
3337
|
+
* @param {number | null} [count]
|
|
3338
|
+
* @param {boolean | null} [order_ascending]
|
|
3339
|
+
* @returns {Promise<any>}
|
|
3340
|
+
*/
|
|
3341
|
+
getContestedResourceVotersForIdentityWithProofInfo(data_contract_id, document_type_name, index_name, index_values, contestant_id, start_at_identifier_info, count, order_ascending) {
|
|
3342
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3343
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3344
|
+
const ptr1 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3345
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3346
|
+
const ptr2 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3347
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3348
|
+
const ptr3 = passArrayJsValueToWasm0(index_values, wasm.__wbindgen_malloc);
|
|
3349
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3350
|
+
const ptr4 = passStringToWasm0(contestant_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3351
|
+
const len4 = WASM_VECTOR_LEN;
|
|
3352
|
+
var ptr5 = isLikeNone(start_at_identifier_info) ? 0 : passStringToWasm0(start_at_identifier_info, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3353
|
+
var len5 = WASM_VECTOR_LEN;
|
|
3354
|
+
const ret = wasm.wasmsdk_getContestedResourceVotersForIdentityWithProofInfo(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, isLikeNone(count) ? 0x100000001 : (count) >>> 0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3355
|
+
return ret;
|
|
3356
|
+
}
|
|
3357
|
+
/**
|
|
3358
|
+
* @param {string} identity_id
|
|
3359
|
+
* @param {number | null} [limit]
|
|
3360
|
+
* @param {number | null} [offset]
|
|
3361
|
+
* @param {boolean | null} [order_ascending]
|
|
3362
|
+
* @returns {Promise<any>}
|
|
3363
|
+
*/
|
|
3364
|
+
getContestedResourceIdentityVotesWithProofInfo(identity_id, limit, offset, order_ascending) {
|
|
3365
|
+
const ptr0 = passStringToWasm0(identity_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3367
|
+
const ret = wasm.wasmsdk_getContestedResourceIdentityVotesWithProofInfo(this.__wbg_ptr, ptr0, len0, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(offset) ? 0x100000001 : (offset) >>> 0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3368
|
+
return ret;
|
|
3369
|
+
}
|
|
3370
|
+
/**
|
|
3371
|
+
* @param {bigint | null} [start_time_ms]
|
|
3372
|
+
* @param {bigint | null} [end_time_ms]
|
|
3373
|
+
* @param {number | null} [limit]
|
|
3374
|
+
* @param {number | null} [offset]
|
|
3375
|
+
* @param {boolean | null} [order_ascending]
|
|
3376
|
+
* @returns {Promise<any>}
|
|
3377
|
+
*/
|
|
3378
|
+
getVotePollsByEndDateWithProofInfo(start_time_ms, end_time_ms, limit, offset, order_ascending) {
|
|
3379
|
+
const ret = wasm.wasmsdk_getVotePollsByEndDateWithProofInfo(this.__wbg_ptr, !isLikeNone(start_time_ms), isLikeNone(start_time_ms) ? BigInt(0) : start_time_ms, !isLikeNone(end_time_ms), isLikeNone(end_time_ms) ? BigInt(0) : end_time_ms, isLikeNone(limit) ? 0x100000001 : (limit) >>> 0, isLikeNone(offset) ? 0x100000001 : (offset) >>> 0, isLikeNone(order_ascending) ? 0xFFFFFF : order_ascending ? 1 : 0);
|
|
3380
|
+
return ret;
|
|
3381
|
+
}
|
|
3382
|
+
/**
|
|
3383
|
+
* @param {string} data_contract_id
|
|
3384
|
+
* @param {string} document_type_name
|
|
3385
|
+
* @param {string} index_name
|
|
3386
|
+
* @param {any[]} index_values
|
|
3387
|
+
* @param {string} _result_type
|
|
3388
|
+
* @param {boolean | null} [allow_include_locked_and_abstaining_vote_tally]
|
|
3389
|
+
* @param {string | null} [start_at_identifier_info]
|
|
3390
|
+
* @param {number | null} [count]
|
|
3391
|
+
* @param {boolean | null} [_order_ascending]
|
|
3392
|
+
* @returns {Promise<any>}
|
|
3393
|
+
*/
|
|
3394
|
+
getContestedResourceVoteState(data_contract_id, document_type_name, index_name, index_values, _result_type, allow_include_locked_and_abstaining_vote_tally, start_at_identifier_info, count, _order_ascending) {
|
|
3395
|
+
const ptr0 = passStringToWasm0(data_contract_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3396
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3397
|
+
const ptr1 = passStringToWasm0(document_type_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3398
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3399
|
+
const ptr2 = passStringToWasm0(index_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3400
|
+
const len2 = WASM_VECTOR_LEN;
|
|
3401
|
+
const ptr3 = passArrayJsValueToWasm0(index_values, wasm.__wbindgen_malloc);
|
|
3402
|
+
const len3 = WASM_VECTOR_LEN;
|
|
3403
|
+
const ptr4 = passStringToWasm0(_result_type, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3404
|
+
const len4 = WASM_VECTOR_LEN;
|
|
3405
|
+
var ptr5 = isLikeNone(start_at_identifier_info) ? 0 : passStringToWasm0(start_at_identifier_info, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3406
|
+
var len5 = WASM_VECTOR_LEN;
|
|
3407
|
+
const ret = wasm.wasmsdk_getContestedResourceVoteState(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, isLikeNone(allow_include_locked_and_abstaining_vote_tally) ? 0xFFFFFF : allow_include_locked_and_abstaining_vote_tally ? 1 : 0, ptr5, len5, isLikeNone(count) ? 0x100000001 : (count) >>> 0, isLikeNone(_order_ascending) ? 0xFFFFFF : _order_ascending ? 1 : 0);
|
|
3408
|
+
return ret;
|
|
3409
|
+
}
|
|
3410
|
+
/**
|
|
3411
|
+
* Generate a new random key pair
|
|
3412
|
+
* @param {string} network
|
|
3413
|
+
* @returns {any}
|
|
3414
|
+
*/
|
|
3415
|
+
static generateKeyPair(network) {
|
|
3416
|
+
const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3417
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3418
|
+
const ret = wasm.wasmsdk_generateKeyPair(ptr0, len0);
|
|
3419
|
+
if (ret[2]) {
|
|
3420
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3421
|
+
}
|
|
3422
|
+
return takeFromExternrefTable0(ret[0]);
|
|
3423
|
+
}
|
|
3424
|
+
/**
|
|
3425
|
+
* Generate multiple key pairs
|
|
3426
|
+
* @param {string} network
|
|
3427
|
+
* @param {number} count
|
|
3428
|
+
* @returns {any[]}
|
|
3429
|
+
*/
|
|
3430
|
+
static generateKeyPairs(network, count) {
|
|
3431
|
+
const ptr0 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3432
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3433
|
+
const ret = wasm.wasmsdk_generateKeyPairs(ptr0, len0, count);
|
|
3434
|
+
if (ret[3]) {
|
|
3435
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3436
|
+
}
|
|
3437
|
+
var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
3438
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
3439
|
+
return v2;
|
|
3440
|
+
}
|
|
3441
|
+
/**
|
|
3442
|
+
* Create key pair from private key WIF
|
|
3443
|
+
* @param {string} private_key_wif
|
|
3444
|
+
* @returns {any}
|
|
3445
|
+
*/
|
|
3446
|
+
static keyPairFromWif(private_key_wif) {
|
|
3447
|
+
const ptr0 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3448
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3449
|
+
const ret = wasm.wasmsdk_keyPairFromWif(ptr0, len0);
|
|
3450
|
+
if (ret[2]) {
|
|
3451
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3452
|
+
}
|
|
3453
|
+
return takeFromExternrefTable0(ret[0]);
|
|
3454
|
+
}
|
|
3455
|
+
/**
|
|
3456
|
+
* Create key pair from private key hex
|
|
3457
|
+
* @param {string} private_key_hex
|
|
3458
|
+
* @param {string} network
|
|
3459
|
+
* @returns {any}
|
|
3460
|
+
*/
|
|
3461
|
+
static keyPairFromHex(private_key_hex, network) {
|
|
3462
|
+
const ptr0 = passStringToWasm0(private_key_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3463
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3464
|
+
const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3465
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3466
|
+
const ret = wasm.wasmsdk_keyPairFromHex(ptr0, len0, ptr1, len1);
|
|
3467
|
+
if (ret[2]) {
|
|
3468
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3469
|
+
}
|
|
3470
|
+
return takeFromExternrefTable0(ret[0]);
|
|
3471
|
+
}
|
|
3472
|
+
/**
|
|
3473
|
+
* Get address from public key
|
|
3474
|
+
* @param {string} pubkey_hex
|
|
3475
|
+
* @param {string} network
|
|
3476
|
+
* @returns {string}
|
|
3477
|
+
*/
|
|
3478
|
+
static pubkeyToAddress(pubkey_hex, network) {
|
|
3479
|
+
let deferred4_0;
|
|
3480
|
+
let deferred4_1;
|
|
3481
|
+
try {
|
|
3482
|
+
const ptr0 = passStringToWasm0(pubkey_hex, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3483
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3484
|
+
const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3485
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3486
|
+
const ret = wasm.wasmsdk_pubkeyToAddress(ptr0, len0, ptr1, len1);
|
|
3487
|
+
var ptr3 = ret[0];
|
|
3488
|
+
var len3 = ret[1];
|
|
3489
|
+
if (ret[3]) {
|
|
3490
|
+
ptr3 = 0; len3 = 0;
|
|
3491
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3492
|
+
}
|
|
3493
|
+
deferred4_0 = ptr3;
|
|
3494
|
+
deferred4_1 = len3;
|
|
3495
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3496
|
+
} finally {
|
|
3497
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3498
|
+
}
|
|
3499
|
+
}
|
|
3500
|
+
/**
|
|
3501
|
+
* Validate a Dash address
|
|
3502
|
+
* @param {string} address
|
|
3503
|
+
* @param {string} network
|
|
3504
|
+
* @returns {boolean}
|
|
3505
|
+
*/
|
|
3506
|
+
static validateAddress(address, network) {
|
|
3507
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3508
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3509
|
+
const ptr1 = passStringToWasm0(network, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3510
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3511
|
+
const ret = wasm.wasmsdk_validateAddress(ptr0, len0, ptr1, len1);
|
|
3512
|
+
return ret !== 0;
|
|
3513
|
+
}
|
|
3514
|
+
/**
|
|
3515
|
+
* Sign a message with a private key
|
|
3516
|
+
* @param {string} message
|
|
3517
|
+
* @param {string} private_key_wif
|
|
3518
|
+
* @returns {string}
|
|
3519
|
+
*/
|
|
3520
|
+
static signMessage(message, private_key_wif) {
|
|
3521
|
+
let deferred4_0;
|
|
3522
|
+
let deferred4_1;
|
|
3523
|
+
try {
|
|
3524
|
+
const ptr0 = passStringToWasm0(message, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3525
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3526
|
+
const ptr1 = passStringToWasm0(private_key_wif, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3527
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3528
|
+
const ret = wasm.wasmsdk_signMessage(ptr0, len0, ptr1, len1);
|
|
3529
|
+
var ptr3 = ret[0];
|
|
3530
|
+
var len3 = ret[1];
|
|
3531
|
+
if (ret[3]) {
|
|
3532
|
+
ptr3 = 0; len3 = 0;
|
|
3533
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
3534
|
+
}
|
|
3535
|
+
deferred4_0 = ptr3;
|
|
3536
|
+
deferred4_1 = len3;
|
|
3537
|
+
return getStringFromWasm0(ptr3, len3);
|
|
3538
|
+
} finally {
|
|
3539
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
3540
|
+
}
|
|
3541
|
+
}
|
|
3542
|
+
}
|
|
3543
|
+
|
|
3544
|
+
const WasmSdkBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3545
|
+
? { register: () => {}, unregister: () => {} }
|
|
3546
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsdkbuilder_free(ptr >>> 0, 1));
|
|
3547
|
+
|
|
3548
|
+
export class WasmSdkBuilder {
|
|
3549
|
+
|
|
3550
|
+
static __wrap(ptr) {
|
|
3551
|
+
ptr = ptr >>> 0;
|
|
3552
|
+
const obj = Object.create(WasmSdkBuilder.prototype);
|
|
3553
|
+
obj.__wbg_ptr = ptr;
|
|
3554
|
+
WasmSdkBuilderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3555
|
+
return obj;
|
|
3556
|
+
}
|
|
3557
|
+
|
|
3558
|
+
__destroy_into_raw() {
|
|
3559
|
+
const ptr = this.__wbg_ptr;
|
|
3560
|
+
this.__wbg_ptr = 0;
|
|
3561
|
+
WasmSdkBuilderFinalization.unregister(this);
|
|
3562
|
+
return ptr;
|
|
3563
|
+
}
|
|
3564
|
+
|
|
3565
|
+
free() {
|
|
3566
|
+
const ptr = this.__destroy_into_raw();
|
|
3567
|
+
wasm.__wbg_wasmsdkbuilder_free(ptr, 0);
|
|
3568
|
+
}
|
|
3569
|
+
/**
|
|
3570
|
+
* Get the latest platform version number
|
|
3571
|
+
* @returns {number}
|
|
3572
|
+
*/
|
|
3573
|
+
static getLatestVersionNumber() {
|
|
3574
|
+
const ret = wasm.wasmsdkbuilder_getLatestVersionNumber();
|
|
3575
|
+
return ret >>> 0;
|
|
3576
|
+
}
|
|
3577
|
+
/**
|
|
3578
|
+
* @returns {WasmSdkBuilder}
|
|
3579
|
+
*/
|
|
3580
|
+
static mainnet() {
|
|
3581
|
+
const ret = wasm.wasmsdkbuilder_mainnet();
|
|
3582
|
+
return WasmSdkBuilder.__wrap(ret);
|
|
3583
|
+
}
|
|
3584
|
+
/**
|
|
3585
|
+
* @returns {WasmSdkBuilder}
|
|
3586
|
+
*/
|
|
3587
|
+
static mainnetTrusted() {
|
|
3588
|
+
const ret = wasm.wasmsdkbuilder_mainnetTrusted();
|
|
3589
|
+
if (ret[2]) {
|
|
3590
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3591
|
+
}
|
|
3592
|
+
return WasmSdkBuilder.__wrap(ret[0]);
|
|
3593
|
+
}
|
|
3594
|
+
/**
|
|
3595
|
+
* @returns {WasmSdkBuilder}
|
|
3596
|
+
*/
|
|
3597
|
+
static testnet() {
|
|
3598
|
+
const ret = wasm.wasmsdkbuilder_testnet();
|
|
3599
|
+
return WasmSdkBuilder.__wrap(ret);
|
|
3600
|
+
}
|
|
3601
|
+
/**
|
|
3602
|
+
* @returns {WasmSdkBuilder}
|
|
3603
|
+
*/
|
|
3604
|
+
static testnetTrusted() {
|
|
3605
|
+
const ret = wasm.wasmsdkbuilder_testnetTrusted();
|
|
3606
|
+
if (ret[2]) {
|
|
3607
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3608
|
+
}
|
|
3609
|
+
return WasmSdkBuilder.__wrap(ret[0]);
|
|
3610
|
+
}
|
|
3611
|
+
/**
|
|
3612
|
+
* @returns {WasmSdk}
|
|
3613
|
+
*/
|
|
3614
|
+
build() {
|
|
3615
|
+
const ptr = this.__destroy_into_raw();
|
|
3616
|
+
const ret = wasm.wasmsdkbuilder_build(ptr);
|
|
3617
|
+
if (ret[2]) {
|
|
3618
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3619
|
+
}
|
|
3620
|
+
return WasmSdk.__wrap(ret[0]);
|
|
3621
|
+
}
|
|
3622
|
+
/**
|
|
3623
|
+
* @param {WasmContext} context_provider
|
|
3624
|
+
* @returns {WasmSdkBuilder}
|
|
3625
|
+
*/
|
|
3626
|
+
withContextProvider(context_provider) {
|
|
3627
|
+
const ptr = this.__destroy_into_raw();
|
|
3628
|
+
_assertClass(context_provider, WasmContext);
|
|
3629
|
+
var ptr0 = context_provider.__destroy_into_raw();
|
|
3630
|
+
const ret = wasm.wasmsdkbuilder_withContextProvider(ptr, ptr0);
|
|
3631
|
+
return WasmSdkBuilder.__wrap(ret);
|
|
3632
|
+
}
|
|
3633
|
+
/**
|
|
3634
|
+
* Configure platform version to use.
|
|
3635
|
+
*
|
|
3636
|
+
* Available versions:
|
|
3637
|
+
* - 1: Platform version 1
|
|
3638
|
+
* - 2: Platform version 2
|
|
3639
|
+
* - ... up to latest version
|
|
3640
|
+
*
|
|
3641
|
+
* Defaults to latest version if not specified.
|
|
3642
|
+
* @param {number} version_number
|
|
3643
|
+
* @returns {WasmSdkBuilder}
|
|
3644
|
+
*/
|
|
3645
|
+
withVersion(version_number) {
|
|
3646
|
+
const ptr = this.__destroy_into_raw();
|
|
3647
|
+
const ret = wasm.wasmsdkbuilder_withVersion(ptr, version_number);
|
|
3648
|
+
if (ret[2]) {
|
|
3649
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3650
|
+
}
|
|
3651
|
+
return WasmSdkBuilder.__wrap(ret[0]);
|
|
3652
|
+
}
|
|
3653
|
+
/**
|
|
3654
|
+
* Configure request settings for the SDK.
|
|
3655
|
+
*
|
|
3656
|
+
* Settings include:
|
|
3657
|
+
* - connect_timeout_ms: Timeout for establishing connection (in milliseconds)
|
|
3658
|
+
* - timeout_ms: Timeout for single request (in milliseconds)
|
|
3659
|
+
* - retries: Number of retries in case of failed requests
|
|
3660
|
+
* - ban_failed_address: Whether to ban DAPI address if node not responded or responded with error
|
|
3661
|
+
* @param {number | null} [connect_timeout_ms]
|
|
3662
|
+
* @param {number | null} [timeout_ms]
|
|
3663
|
+
* @param {number | null} [retries]
|
|
3664
|
+
* @param {boolean | null} [ban_failed_address]
|
|
3665
|
+
* @returns {WasmSdkBuilder}
|
|
3666
|
+
*/
|
|
3667
|
+
withSettings(connect_timeout_ms, timeout_ms, retries, ban_failed_address) {
|
|
3668
|
+
const ptr = this.__destroy_into_raw();
|
|
3669
|
+
const ret = wasm.wasmsdkbuilder_withSettings(ptr, isLikeNone(connect_timeout_ms) ? 0x100000001 : (connect_timeout_ms) >>> 0, isLikeNone(timeout_ms) ? 0x100000001 : (timeout_ms) >>> 0, isLikeNone(retries) ? 0x100000001 : (retries) >>> 0, isLikeNone(ban_failed_address) ? 0xFFFFFF : ban_failed_address ? 1 : 0);
|
|
3670
|
+
return WasmSdkBuilder.__wrap(ret);
|
|
3671
|
+
}
|
|
3672
|
+
/**
|
|
3673
|
+
* @param {boolean} enable_proofs
|
|
3674
|
+
* @returns {WasmSdkBuilder}
|
|
3675
|
+
*/
|
|
3676
|
+
withProofs(enable_proofs) {
|
|
3677
|
+
const ptr = this.__destroy_into_raw();
|
|
3678
|
+
const ret = wasm.wasmsdkbuilder_withProofs(ptr, enable_proofs);
|
|
3679
|
+
return WasmSdkBuilder.__wrap(ret);
|
|
3680
|
+
}
|
|
3681
|
+
/**
|
|
3682
|
+
* Configure tracing/logging via the builder
|
|
3683
|
+
* Returns a new builder with logging configured
|
|
3684
|
+
* @param {string} level_or_filter
|
|
3685
|
+
* @returns {WasmSdkBuilder}
|
|
3686
|
+
*/
|
|
3687
|
+
withLogs(level_or_filter) {
|
|
3688
|
+
const ptr = this.__destroy_into_raw();
|
|
3689
|
+
const ptr0 = passStringToWasm0(level_or_filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3690
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3691
|
+
const ret = wasm.wasmsdkbuilder_withLogs(ptr, ptr0, len0);
|
|
3692
|
+
if (ret[2]) {
|
|
3693
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
3694
|
+
}
|
|
3695
|
+
return WasmSdkBuilder.__wrap(ret[0]);
|
|
3696
|
+
}
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
const WasmSdkErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3700
|
+
? { register: () => {}, unregister: () => {} }
|
|
3701
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsdkerror_free(ptr >>> 0, 1));
|
|
3702
|
+
/**
|
|
3703
|
+
* Structured error surfaced to JS consumers
|
|
3704
|
+
*/
|
|
3705
|
+
export class WasmSdkError {
|
|
3706
|
+
|
|
3707
|
+
static __wrap(ptr) {
|
|
3708
|
+
ptr = ptr >>> 0;
|
|
3709
|
+
const obj = Object.create(WasmSdkError.prototype);
|
|
3710
|
+
obj.__wbg_ptr = ptr;
|
|
3711
|
+
WasmSdkErrorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3712
|
+
return obj;
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3715
|
+
__destroy_into_raw() {
|
|
3716
|
+
const ptr = this.__wbg_ptr;
|
|
3717
|
+
this.__wbg_ptr = 0;
|
|
3718
|
+
WasmSdkErrorFinalization.unregister(this);
|
|
3719
|
+
return ptr;
|
|
3720
|
+
}
|
|
3721
|
+
|
|
3722
|
+
free() {
|
|
3723
|
+
const ptr = this.__destroy_into_raw();
|
|
3724
|
+
wasm.__wbg_wasmsdkerror_free(ptr, 0);
|
|
3725
|
+
}
|
|
3726
|
+
/**
|
|
3727
|
+
* Error kind (enum)
|
|
3728
|
+
* @returns {WasmSdkErrorKind}
|
|
3729
|
+
*/
|
|
3730
|
+
get kind() {
|
|
3731
|
+
const ret = wasm.wasmsdkerror_kind(this.__wbg_ptr);
|
|
3732
|
+
return ret;
|
|
3733
|
+
}
|
|
3734
|
+
/**
|
|
3735
|
+
* Backwards-compatible name string for the kind
|
|
3736
|
+
* @returns {string}
|
|
3737
|
+
*/
|
|
3738
|
+
get name() {
|
|
3739
|
+
let deferred1_0;
|
|
3740
|
+
let deferred1_1;
|
|
3741
|
+
try {
|
|
3742
|
+
const ret = wasm.wasmsdkerror_name(this.__wbg_ptr);
|
|
3743
|
+
deferred1_0 = ret[0];
|
|
3744
|
+
deferred1_1 = ret[1];
|
|
3745
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3746
|
+
} finally {
|
|
3747
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3748
|
+
}
|
|
3749
|
+
}
|
|
3750
|
+
/**
|
|
3751
|
+
* Human-readable message
|
|
3752
|
+
* @returns {string}
|
|
3753
|
+
*/
|
|
3754
|
+
get message() {
|
|
3755
|
+
let deferred1_0;
|
|
3756
|
+
let deferred1_1;
|
|
3757
|
+
try {
|
|
3758
|
+
const ret = wasm.wasmsdkerror_message(this.__wbg_ptr);
|
|
3759
|
+
deferred1_0 = ret[0];
|
|
3760
|
+
deferred1_1 = ret[1];
|
|
3761
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
3762
|
+
} finally {
|
|
3763
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
3764
|
+
}
|
|
3765
|
+
}
|
|
3766
|
+
/**
|
|
3767
|
+
* Optional numeric code. -1 means absent/not applicable
|
|
3768
|
+
* @returns {number}
|
|
3769
|
+
*/
|
|
3770
|
+
get code() {
|
|
3771
|
+
const ret = wasm.wasmsdkerror_code(this.__wbg_ptr);
|
|
3772
|
+
return ret;
|
|
3773
|
+
}
|
|
3774
|
+
/**
|
|
3775
|
+
* Whether the error is retryable
|
|
3776
|
+
* @returns {boolean}
|
|
3777
|
+
*/
|
|
3778
|
+
get retriable() {
|
|
3779
|
+
const ret = wasm.wasmsdkerror_retriable(this.__wbg_ptr);
|
|
3780
|
+
return ret !== 0;
|
|
3781
|
+
}
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
async function __wbg_load(module, imports) {
|
|
3785
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
3786
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
3787
|
+
try {
|
|
3788
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
3789
|
+
|
|
3790
|
+
} catch (e) {
|
|
3791
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
3792
|
+
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);
|
|
3793
|
+
|
|
3794
|
+
} else {
|
|
3795
|
+
throw e;
|
|
3796
|
+
}
|
|
3797
|
+
}
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
|
+
const bytes = await module.arrayBuffer();
|
|
3801
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
3802
|
+
|
|
3803
|
+
} else {
|
|
3804
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
3805
|
+
|
|
3806
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
3807
|
+
return { instance, module };
|
|
3808
|
+
|
|
3809
|
+
} else {
|
|
3810
|
+
return instance;
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
|
|
3815
|
+
function __wbg_get_imports() {
|
|
3816
|
+
const imports = {};
|
|
3817
|
+
imports.wbg = {};
|
|
3818
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
3819
|
+
const ret = String(arg1);
|
|
3820
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
3821
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3822
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
3823
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
3824
|
+
};
|
|
3825
|
+
imports.wbg.__wbg_abort_410ec47a64ac6117 = function(arg0, arg1) {
|
|
3826
|
+
arg0.abort(arg1);
|
|
3827
|
+
};
|
|
3828
|
+
imports.wbg.__wbg_abort_775ef1d17fc65868 = function(arg0) {
|
|
3829
|
+
arg0.abort();
|
|
3830
|
+
};
|
|
3831
|
+
imports.wbg.__wbg_append_8c7dd8d641a5f01b = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
3832
|
+
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
3833
|
+
}, arguments) };
|
|
3834
|
+
imports.wbg.__wbg_arrayBuffer_d1b44c4390db422f = function() { return handleError(function (arg0) {
|
|
3835
|
+
const ret = arg0.arrayBuffer();
|
|
3836
|
+
return ret;
|
|
3837
|
+
}, arguments) };
|
|
3838
|
+
imports.wbg.__wbg_body_0b8fd1fe671660df = function(arg0) {
|
|
3839
|
+
const ret = arg0.body;
|
|
3840
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3841
|
+
};
|
|
3842
|
+
imports.wbg.__wbg_buffer_09165b52af8c5237 = function(arg0) {
|
|
3843
|
+
const ret = arg0.buffer;
|
|
3844
|
+
return ret;
|
|
3845
|
+
};
|
|
3846
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
3847
|
+
const ret = arg0.buffer;
|
|
3848
|
+
return ret;
|
|
3849
|
+
};
|
|
3850
|
+
imports.wbg.__wbg_byobRequest_77d9adf63337edfb = function(arg0) {
|
|
3851
|
+
const ret = arg0.byobRequest;
|
|
3852
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
3853
|
+
};
|
|
3854
|
+
imports.wbg.__wbg_byteLength_e674b853d9c77e1d = function(arg0) {
|
|
3855
|
+
const ret = arg0.byteLength;
|
|
3856
|
+
return ret;
|
|
3857
|
+
};
|
|
3858
|
+
imports.wbg.__wbg_byteOffset_fd862df290ef848d = function(arg0) {
|
|
3859
|
+
const ret = arg0.byteOffset;
|
|
3860
|
+
return ret;
|
|
3861
|
+
};
|
|
3862
|
+
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
3863
|
+
const ret = arg0.call(arg1);
|
|
3864
|
+
return ret;
|
|
3865
|
+
}, arguments) };
|
|
3866
|
+
imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
3867
|
+
const ret = arg0.call(arg1, arg2);
|
|
3868
|
+
return ret;
|
|
3869
|
+
}, arguments) };
|
|
3870
|
+
imports.wbg.__wbg_cancel_8a308660caa6cadf = function(arg0) {
|
|
3871
|
+
const ret = arg0.cancel();
|
|
3872
|
+
return ret;
|
|
3873
|
+
};
|
|
3874
|
+
imports.wbg.__wbg_catch_a6e601879b2610e9 = function(arg0, arg1) {
|
|
3875
|
+
const ret = arg0.catch(arg1);
|
|
3876
|
+
return ret;
|
|
3877
|
+
};
|
|
3878
|
+
imports.wbg.__wbg_clearTimeout_2e2c4939388cdfbb = function(arg0) {
|
|
3879
|
+
const ret = clearTimeout(arg0);
|
|
3880
|
+
return ret;
|
|
3881
|
+
};
|
|
3882
|
+
imports.wbg.__wbg_clearTimeout_5a54f8841c30079a = function(arg0) {
|
|
3883
|
+
const ret = clearTimeout(arg0);
|
|
3884
|
+
return ret;
|
|
3885
|
+
};
|
|
3886
|
+
imports.wbg.__wbg_clearTimeout_6222fede17abcb1a = function(arg0) {
|
|
3887
|
+
const ret = clearTimeout(arg0);
|
|
3888
|
+
return ret;
|
|
3889
|
+
};
|
|
3890
|
+
imports.wbg.__wbg_close_304cc1fef3466669 = function() { return handleError(function (arg0) {
|
|
3891
|
+
arg0.close();
|
|
3892
|
+
}, arguments) };
|
|
3893
|
+
imports.wbg.__wbg_close_5ce03e29be453811 = function() { return handleError(function (arg0) {
|
|
3894
|
+
arg0.close();
|
|
3895
|
+
}, arguments) };
|
|
3896
|
+
imports.wbg.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
|
|
3897
|
+
const ret = arg0.crypto;
|
|
3898
|
+
return ret;
|
|
3899
|
+
};
|
|
3900
|
+
imports.wbg.__wbg_datacontractwasm_new = function(arg0) {
|
|
3901
|
+
const ret = DataContractWasm.__wrap(arg0);
|
|
3902
|
+
return ret;
|
|
3903
|
+
};
|
|
3904
|
+
imports.wbg.__wbg_documentwasm_new = function(arg0) {
|
|
3905
|
+
const ret = DocumentWasm.__wrap(arg0);
|
|
3906
|
+
return ret;
|
|
3907
|
+
};
|
|
3908
|
+
imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
3909
|
+
const ret = arg0.done;
|
|
3910
|
+
return ret;
|
|
3911
|
+
};
|
|
3912
|
+
imports.wbg.__wbg_enqueue_bb16ba72f537dc9e = function() { return handleError(function (arg0, arg1) {
|
|
3913
|
+
arg0.enqueue(arg1);
|
|
3914
|
+
}, arguments) };
|
|
3915
|
+
imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
|
|
3916
|
+
const ret = Object.entries(arg0);
|
|
3917
|
+
return ret;
|
|
3918
|
+
};
|
|
3919
|
+
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
3920
|
+
let deferred0_0;
|
|
3921
|
+
let deferred0_1;
|
|
3922
|
+
try {
|
|
3923
|
+
deferred0_0 = arg0;
|
|
3924
|
+
deferred0_1 = arg1;
|
|
3925
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
3926
|
+
} finally {
|
|
3927
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
3928
|
+
}
|
|
3929
|
+
};
|
|
3930
|
+
imports.wbg.__wbg_fetch_07cd86dd296a5a63 = function(arg0, arg1, arg2) {
|
|
3931
|
+
const ret = arg0.fetch(arg1, arg2);
|
|
3932
|
+
return ret;
|
|
3933
|
+
};
|
|
3934
|
+
imports.wbg.__wbg_fetch_509096533071c657 = function(arg0, arg1) {
|
|
3935
|
+
const ret = arg0.fetch(arg1);
|
|
3936
|
+
return ret;
|
|
3937
|
+
};
|
|
3938
|
+
imports.wbg.__wbg_fetch_53eef7df7b439a49 = function(arg0, arg1) {
|
|
3939
|
+
const ret = fetch(arg0, arg1);
|
|
3940
|
+
return ret;
|
|
3941
|
+
};
|
|
3942
|
+
imports.wbg.__wbg_fetch_f156d10be9a5c88a = function(arg0) {
|
|
3943
|
+
const ret = fetch(arg0);
|
|
3944
|
+
return ret;
|
|
3945
|
+
};
|
|
3946
|
+
imports.wbg.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
|
|
3947
|
+
const ret = Array.from(arg0);
|
|
3948
|
+
return ret;
|
|
3949
|
+
};
|
|
3950
|
+
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
3951
|
+
arg0.getRandomValues(arg1);
|
|
3952
|
+
}, arguments) };
|
|
3953
|
+
imports.wbg.__wbg_getReader_48e00749fe3f6089 = function() { return handleError(function (arg0) {
|
|
3954
|
+
const ret = arg0.getReader();
|
|
3955
|
+
return ret;
|
|
3956
|
+
}, arguments) };
|
|
3957
|
+
imports.wbg.__wbg_getTime_46267b1c24877e30 = function(arg0) {
|
|
3958
|
+
const ret = arg0.getTime();
|
|
3959
|
+
return ret;
|
|
3960
|
+
};
|
|
3961
|
+
imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
3962
|
+
const ret = Reflect.get(arg0, arg1);
|
|
3963
|
+
return ret;
|
|
3964
|
+
}, arguments) };
|
|
3965
|
+
imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
3966
|
+
const ret = arg0[arg1 >>> 0];
|
|
3967
|
+
return ret;
|
|
3968
|
+
};
|
|
3969
|
+
imports.wbg.__wbg_getdone_d47073731acd3e74 = function(arg0) {
|
|
3970
|
+
const ret = arg0.done;
|
|
3971
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
3972
|
+
};
|
|
3973
|
+
imports.wbg.__wbg_getvalue_009dcd63692bee1f = function(arg0) {
|
|
3974
|
+
const ret = arg0.value;
|
|
3975
|
+
return ret;
|
|
3976
|
+
};
|
|
3977
|
+
imports.wbg.__wbg_has_a5ea9117f258a0ec = function() { return handleError(function (arg0, arg1) {
|
|
3978
|
+
const ret = Reflect.has(arg0, arg1);
|
|
3979
|
+
return ret;
|
|
3980
|
+
}, arguments) };
|
|
3981
|
+
imports.wbg.__wbg_headers_9cb51cfd2ac780a4 = function(arg0) {
|
|
3982
|
+
const ret = arg0.headers;
|
|
3983
|
+
return ret;
|
|
3984
|
+
};
|
|
3985
|
+
imports.wbg.__wbg_identitywasm_new = function(arg0) {
|
|
3986
|
+
const ret = IdentityWasm.__wrap(arg0);
|
|
3987
|
+
return ret;
|
|
3988
|
+
};
|
|
3989
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
3990
|
+
let result;
|
|
3991
|
+
try {
|
|
3992
|
+
result = arg0 instanceof ArrayBuffer;
|
|
3993
|
+
} catch (_) {
|
|
3994
|
+
result = false;
|
|
3995
|
+
}
|
|
3996
|
+
const ret = result;
|
|
3997
|
+
return ret;
|
|
3998
|
+
};
|
|
3999
|
+
imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
|
|
4000
|
+
let result;
|
|
4001
|
+
try {
|
|
4002
|
+
result = arg0 instanceof Map;
|
|
4003
|
+
} catch (_) {
|
|
4004
|
+
result = false;
|
|
4005
|
+
}
|
|
4006
|
+
const ret = result;
|
|
4007
|
+
return ret;
|
|
4008
|
+
};
|
|
4009
|
+
imports.wbg.__wbg_instanceof_Object_7f2dcef8f78644a4 = function(arg0) {
|
|
4010
|
+
let result;
|
|
4011
|
+
try {
|
|
4012
|
+
result = arg0 instanceof Object;
|
|
4013
|
+
} catch (_) {
|
|
4014
|
+
result = false;
|
|
4015
|
+
}
|
|
4016
|
+
const ret = result;
|
|
4017
|
+
return ret;
|
|
4018
|
+
};
|
|
4019
|
+
imports.wbg.__wbg_instanceof_Response_f2cc20d9f7dfd644 = function(arg0) {
|
|
4020
|
+
let result;
|
|
4021
|
+
try {
|
|
4022
|
+
result = arg0 instanceof Response;
|
|
4023
|
+
} catch (_) {
|
|
4024
|
+
result = false;
|
|
4025
|
+
}
|
|
4026
|
+
const ret = result;
|
|
4027
|
+
return ret;
|
|
4028
|
+
};
|
|
4029
|
+
imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
4030
|
+
let result;
|
|
4031
|
+
try {
|
|
4032
|
+
result = arg0 instanceof Uint8Array;
|
|
4033
|
+
} catch (_) {
|
|
4034
|
+
result = false;
|
|
4035
|
+
}
|
|
4036
|
+
const ret = result;
|
|
4037
|
+
return ret;
|
|
4038
|
+
};
|
|
4039
|
+
imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
4040
|
+
const ret = Array.isArray(arg0);
|
|
4041
|
+
return ret;
|
|
4042
|
+
};
|
|
4043
|
+
imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
|
4044
|
+
const ret = Number.isSafeInteger(arg0);
|
|
4045
|
+
return ret;
|
|
4046
|
+
};
|
|
4047
|
+
imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
4048
|
+
const ret = Symbol.iterator;
|
|
4049
|
+
return ret;
|
|
4050
|
+
};
|
|
4051
|
+
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
4052
|
+
const ret = arg0.length;
|
|
4053
|
+
return ret;
|
|
4054
|
+
};
|
|
4055
|
+
imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
4056
|
+
const ret = arg0.length;
|
|
4057
|
+
return ret;
|
|
4058
|
+
};
|
|
4059
|
+
imports.wbg.__wbg_log_0cc1b7768397bcfe = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
|
|
4060
|
+
let deferred0_0;
|
|
4061
|
+
let deferred0_1;
|
|
4062
|
+
try {
|
|
4063
|
+
deferred0_0 = arg0;
|
|
4064
|
+
deferred0_1 = arg1;
|
|
4065
|
+
console.log(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), getStringFromWasm0(arg4, arg5), getStringFromWasm0(arg6, arg7));
|
|
4066
|
+
} finally {
|
|
4067
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4068
|
+
}
|
|
4069
|
+
};
|
|
4070
|
+
imports.wbg.__wbg_log_cb9e190acc5753fb = function(arg0, arg1) {
|
|
4071
|
+
let deferred0_0;
|
|
4072
|
+
let deferred0_1;
|
|
4073
|
+
try {
|
|
4074
|
+
deferred0_0 = arg0;
|
|
4075
|
+
deferred0_1 = arg1;
|
|
4076
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
4077
|
+
} finally {
|
|
4078
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4079
|
+
}
|
|
4080
|
+
};
|
|
4081
|
+
imports.wbg.__wbg_mark_7438147ce31e9d4b = function(arg0, arg1) {
|
|
4082
|
+
performance.mark(getStringFromWasm0(arg0, arg1));
|
|
4083
|
+
};
|
|
4084
|
+
imports.wbg.__wbg_measure_fb7825c11612c823 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
4085
|
+
let deferred0_0;
|
|
4086
|
+
let deferred0_1;
|
|
4087
|
+
let deferred1_0;
|
|
4088
|
+
let deferred1_1;
|
|
4089
|
+
try {
|
|
4090
|
+
deferred0_0 = arg0;
|
|
4091
|
+
deferred0_1 = arg1;
|
|
4092
|
+
deferred1_0 = arg2;
|
|
4093
|
+
deferred1_1 = arg3;
|
|
4094
|
+
performance.measure(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
|
|
4095
|
+
} finally {
|
|
4096
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
4097
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
4098
|
+
}
|
|
4099
|
+
}, arguments) };
|
|
4100
|
+
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
4101
|
+
const ret = arg0.msCrypto;
|
|
4102
|
+
return ret;
|
|
4103
|
+
};
|
|
4104
|
+
imports.wbg.__wbg_new0_f788a2397c7ca929 = function() {
|
|
4105
|
+
const ret = new Date();
|
|
4106
|
+
return ret;
|
|
4107
|
+
};
|
|
4108
|
+
imports.wbg.__wbg_new_018dcc2d6c8c2f6a = function() { return handleError(function () {
|
|
4109
|
+
const ret = new Headers();
|
|
4110
|
+
return ret;
|
|
4111
|
+
}, arguments) };
|
|
4112
|
+
imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
4113
|
+
try {
|
|
4114
|
+
var state0 = {a: arg0, b: arg1};
|
|
4115
|
+
var cb0 = (arg0, arg1) => {
|
|
4116
|
+
const a = state0.a;
|
|
4117
|
+
state0.a = 0;
|
|
4118
|
+
try {
|
|
4119
|
+
return __wbg_adapter_470(a, state0.b, arg0, arg1);
|
|
4120
|
+
} finally {
|
|
4121
|
+
state0.a = a;
|
|
4122
|
+
}
|
|
4123
|
+
};
|
|
4124
|
+
const ret = new Promise(cb0);
|
|
4125
|
+
return ret;
|
|
4126
|
+
} finally {
|
|
4127
|
+
state0.a = state0.b = 0;
|
|
4128
|
+
}
|
|
4129
|
+
};
|
|
4130
|
+
imports.wbg.__wbg_new_405e22f390576ce2 = function() {
|
|
4131
|
+
const ret = new Object();
|
|
4132
|
+
return ret;
|
|
4133
|
+
};
|
|
4134
|
+
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
4135
|
+
const ret = new Map();
|
|
4136
|
+
return ret;
|
|
4137
|
+
};
|
|
4138
|
+
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
4139
|
+
const ret = new Array();
|
|
4140
|
+
return ret;
|
|
4141
|
+
};
|
|
4142
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
4143
|
+
const ret = new Error();
|
|
4144
|
+
return ret;
|
|
4145
|
+
};
|
|
4146
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
4147
|
+
const ret = new Uint8Array(arg0);
|
|
4148
|
+
return ret;
|
|
4149
|
+
};
|
|
4150
|
+
imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
4151
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
4152
|
+
return ret;
|
|
4153
|
+
};
|
|
4154
|
+
imports.wbg.__wbg_new_e25e5aab09ff45db = function() { return handleError(function () {
|
|
4155
|
+
const ret = new AbortController();
|
|
4156
|
+
return ret;
|
|
4157
|
+
}, arguments) };
|
|
4158
|
+
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
4159
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
4160
|
+
return ret;
|
|
4161
|
+
};
|
|
4162
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a = function(arg0, arg1, arg2) {
|
|
4163
|
+
const ret = new Uint8Array(arg0, arg1 >>> 0, arg2 >>> 0);
|
|
4164
|
+
return ret;
|
|
4165
|
+
};
|
|
4166
|
+
imports.wbg.__wbg_newwithlength_a381634e90c276d4 = function(arg0) {
|
|
4167
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
4168
|
+
return ret;
|
|
4169
|
+
};
|
|
4170
|
+
imports.wbg.__wbg_newwithstrandinit_06c535e0a867c635 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
4171
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
4172
|
+
return ret;
|
|
4173
|
+
}, arguments) };
|
|
4174
|
+
imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
4175
|
+
const ret = arg0.next;
|
|
4176
|
+
return ret;
|
|
4177
|
+
};
|
|
4178
|
+
imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
4179
|
+
const ret = arg0.next();
|
|
4180
|
+
return ret;
|
|
4181
|
+
}, arguments) };
|
|
4182
|
+
imports.wbg.__wbg_node_905d3e251edff8a2 = function(arg0) {
|
|
4183
|
+
const ret = arg0.node;
|
|
4184
|
+
return ret;
|
|
4185
|
+
};
|
|
4186
|
+
imports.wbg.__wbg_now_807e54c39636c349 = function() {
|
|
4187
|
+
const ret = Date.now();
|
|
4188
|
+
return ret;
|
|
4189
|
+
};
|
|
4190
|
+
imports.wbg.__wbg_parse_def2e24ef1252aff = function() { return handleError(function (arg0, arg1) {
|
|
4191
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
4192
|
+
return ret;
|
|
4193
|
+
}, arguments) };
|
|
4194
|
+
imports.wbg.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
|
|
4195
|
+
const ret = arg0.process;
|
|
4196
|
+
return ret;
|
|
4197
|
+
};
|
|
4198
|
+
imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
|
|
4199
|
+
const ret = arg0.push(arg1);
|
|
4200
|
+
return ret;
|
|
4201
|
+
};
|
|
4202
|
+
imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
|
4203
|
+
queueMicrotask(arg0);
|
|
4204
|
+
};
|
|
4205
|
+
imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
|
4206
|
+
const ret = arg0.queueMicrotask;
|
|
4207
|
+
return ret;
|
|
4208
|
+
};
|
|
4209
|
+
imports.wbg.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
|
|
4210
|
+
arg0.randomFillSync(arg1);
|
|
4211
|
+
}, arguments) };
|
|
4212
|
+
imports.wbg.__wbg_read_a2434af1186cb56c = function(arg0) {
|
|
4213
|
+
const ret = arg0.read();
|
|
4214
|
+
return ret;
|
|
4215
|
+
};
|
|
4216
|
+
imports.wbg.__wbg_releaseLock_091899af97991d2e = function(arg0) {
|
|
4217
|
+
arg0.releaseLock();
|
|
4218
|
+
};
|
|
4219
|
+
imports.wbg.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
|
|
4220
|
+
const ret = module.require;
|
|
4221
|
+
return ret;
|
|
4222
|
+
}, arguments) };
|
|
4223
|
+
imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
|
4224
|
+
const ret = Promise.resolve(arg0);
|
|
4225
|
+
return ret;
|
|
4226
|
+
};
|
|
4227
|
+
imports.wbg.__wbg_respond_1f279fa9f8edcb1c = function() { return handleError(function (arg0, arg1) {
|
|
4228
|
+
arg0.respond(arg1 >>> 0);
|
|
4229
|
+
}, arguments) };
|
|
4230
|
+
imports.wbg.__wbg_setTimeout_2b339866a2aa3789 = function(arg0, arg1) {
|
|
4231
|
+
const ret = setTimeout(arg0, arg1);
|
|
4232
|
+
return ret;
|
|
4233
|
+
};
|
|
4234
|
+
imports.wbg.__wbg_setTimeout_929c97a7c0f23d36 = function(arg0, arg1) {
|
|
4235
|
+
const ret = setTimeout(arg0, arg1);
|
|
4236
|
+
return ret;
|
|
4237
|
+
};
|
|
4238
|
+
imports.wbg.__wbg_setTimeout_db2dbaeefb6f39c7 = function() { return handleError(function (arg0, arg1) {
|
|
4239
|
+
const ret = setTimeout(arg0, arg1);
|
|
4240
|
+
return ret;
|
|
4241
|
+
}, arguments) };
|
|
4242
|
+
imports.wbg.__wbg_set_11cd83f45504cedf = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
4243
|
+
arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
4244
|
+
}, arguments) };
|
|
4245
|
+
imports.wbg.__wbg_set_37837023f3d740e8 = function(arg0, arg1, arg2) {
|
|
4246
|
+
arg0[arg1 >>> 0] = arg2;
|
|
4247
|
+
};
|
|
4248
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
4249
|
+
arg0[arg1] = arg2;
|
|
4250
|
+
};
|
|
4251
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
4252
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
4253
|
+
};
|
|
4254
|
+
imports.wbg.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
|
|
4255
|
+
const ret = arg0.set(arg1, arg2);
|
|
4256
|
+
return ret;
|
|
4257
|
+
};
|
|
4258
|
+
imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
4259
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
4260
|
+
return ret;
|
|
4261
|
+
}, arguments) };
|
|
4262
|
+
imports.wbg.__wbg_setbody_5923b78a95eedf29 = function(arg0, arg1) {
|
|
4263
|
+
arg0.body = arg1;
|
|
4264
|
+
};
|
|
4265
|
+
imports.wbg.__wbg_setcache_12f17c3a980650e4 = function(arg0, arg1) {
|
|
4266
|
+
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
4267
|
+
};
|
|
4268
|
+
imports.wbg.__wbg_setcredentials_c3a22f1cd105a2c6 = function(arg0, arg1) {
|
|
4269
|
+
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
4270
|
+
};
|
|
4271
|
+
imports.wbg.__wbg_setheaders_834c0bdb6a8949ad = function(arg0, arg1) {
|
|
4272
|
+
arg0.headers = arg1;
|
|
4273
|
+
};
|
|
4274
|
+
imports.wbg.__wbg_setintegrity_564a2397cf837760 = function(arg0, arg1, arg2) {
|
|
4275
|
+
arg0.integrity = getStringFromWasm0(arg1, arg2);
|
|
4276
|
+
};
|
|
4277
|
+
imports.wbg.__wbg_setmethod_3c5280fe5d890842 = function(arg0, arg1, arg2) {
|
|
4278
|
+
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
4279
|
+
};
|
|
4280
|
+
imports.wbg.__wbg_setmode_5dc300b865044b65 = function(arg0, arg1) {
|
|
4281
|
+
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
4282
|
+
};
|
|
4283
|
+
imports.wbg.__wbg_setredirect_40e6a7f717a2f86a = function(arg0, arg1) {
|
|
4284
|
+
arg0.redirect = __wbindgen_enum_RequestRedirect[arg1];
|
|
4285
|
+
};
|
|
4286
|
+
imports.wbg.__wbg_setreferrer_fea46c1230e5e29a = function(arg0, arg1, arg2) {
|
|
4287
|
+
arg0.referrer = getStringFromWasm0(arg1, arg2);
|
|
4288
|
+
};
|
|
4289
|
+
imports.wbg.__wbg_setreferrerpolicy_b73612479f761b6f = function(arg0, arg1) {
|
|
4290
|
+
arg0.referrerPolicy = __wbindgen_enum_ReferrerPolicy[arg1];
|
|
4291
|
+
};
|
|
4292
|
+
imports.wbg.__wbg_setsignal_75b21ef3a81de905 = function(arg0, arg1) {
|
|
4293
|
+
arg0.signal = arg1;
|
|
4294
|
+
};
|
|
4295
|
+
imports.wbg.__wbg_signal_aaf9ad74119f20a4 = function(arg0) {
|
|
4296
|
+
const ret = arg0.signal;
|
|
4297
|
+
return ret;
|
|
4298
|
+
};
|
|
4299
|
+
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
4300
|
+
const ret = arg1.stack;
|
|
4301
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4302
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4303
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4304
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4305
|
+
};
|
|
4306
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
4307
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
4308
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4309
|
+
};
|
|
4310
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
4311
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
4312
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4313
|
+
};
|
|
4314
|
+
imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
4315
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
4316
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4317
|
+
};
|
|
4318
|
+
imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
4319
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
4320
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4321
|
+
};
|
|
4322
|
+
imports.wbg.__wbg_status_f6360336ca686bf0 = function(arg0) {
|
|
4323
|
+
const ret = arg0.status;
|
|
4324
|
+
return ret;
|
|
4325
|
+
};
|
|
4326
|
+
imports.wbg.__wbg_stringify_f7ed6987935b4a24 = function() { return handleError(function (arg0) {
|
|
4327
|
+
const ret = JSON.stringify(arg0);
|
|
4328
|
+
return ret;
|
|
4329
|
+
}, arguments) };
|
|
4330
|
+
imports.wbg.__wbg_subarray_aa9065fa9dc5df96 = function(arg0, arg1, arg2) {
|
|
4331
|
+
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
4332
|
+
return ret;
|
|
4333
|
+
};
|
|
4334
|
+
imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
|
4335
|
+
const ret = arg0.then(arg1);
|
|
4336
|
+
return ret;
|
|
4337
|
+
};
|
|
4338
|
+
imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
|
|
4339
|
+
const ret = arg0.then(arg1, arg2);
|
|
4340
|
+
return ret;
|
|
4341
|
+
};
|
|
4342
|
+
imports.wbg.__wbg_toString_5285597960676b7b = function(arg0) {
|
|
4343
|
+
const ret = arg0.toString();
|
|
4344
|
+
return ret;
|
|
4345
|
+
};
|
|
4346
|
+
imports.wbg.__wbg_toString_b46b28b849433558 = function(arg0) {
|
|
4347
|
+
const ret = arg0.toString();
|
|
4348
|
+
return ret;
|
|
4349
|
+
};
|
|
4350
|
+
imports.wbg.__wbg_url_ae10c34ca209681d = function(arg0, arg1) {
|
|
4351
|
+
const ret = arg1.url;
|
|
4352
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4353
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4354
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4355
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4356
|
+
};
|
|
4357
|
+
imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
4358
|
+
const ret = arg0.value;
|
|
4359
|
+
return ret;
|
|
4360
|
+
};
|
|
4361
|
+
imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
|
|
4362
|
+
const ret = arg0.versions;
|
|
4363
|
+
return ret;
|
|
4364
|
+
};
|
|
4365
|
+
imports.wbg.__wbg_view_fd8a56e8983f448d = function(arg0) {
|
|
4366
|
+
const ret = arg0.view;
|
|
4367
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
4368
|
+
};
|
|
4369
|
+
imports.wbg.__wbg_wasmsdkerror_new = function(arg0) {
|
|
4370
|
+
const ret = WasmSdkError.__wrap(arg0);
|
|
4371
|
+
return ret;
|
|
4372
|
+
};
|
|
4373
|
+
imports.wbg.__wbindgen_array_new = function() {
|
|
4374
|
+
const ret = [];
|
|
4375
|
+
return ret;
|
|
4376
|
+
};
|
|
4377
|
+
imports.wbg.__wbindgen_array_push = function(arg0, arg1) {
|
|
4378
|
+
arg0.push(arg1);
|
|
4379
|
+
};
|
|
4380
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
4381
|
+
const ret = arg0;
|
|
4382
|
+
return ret;
|
|
4383
|
+
};
|
|
4384
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
4385
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
4386
|
+
return ret;
|
|
4387
|
+
};
|
|
4388
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
4389
|
+
const v = arg1;
|
|
4390
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
4391
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
4392
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
4393
|
+
};
|
|
4394
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
4395
|
+
const v = arg0;
|
|
4396
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
4397
|
+
return ret;
|
|
4398
|
+
};
|
|
4399
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
4400
|
+
const obj = arg0.original;
|
|
4401
|
+
if (obj.cnt-- == 1) {
|
|
4402
|
+
obj.a = 0;
|
|
4403
|
+
return true;
|
|
4404
|
+
}
|
|
4405
|
+
const ret = false;
|
|
4406
|
+
return ret;
|
|
4407
|
+
};
|
|
4408
|
+
imports.wbg.__wbindgen_closure_wrapper15993 = function(arg0, arg1, arg2) {
|
|
4409
|
+
const ret = makeMutClosure(arg0, arg1, 5087, __wbg_adapter_59);
|
|
4410
|
+
return ret;
|
|
4411
|
+
};
|
|
4412
|
+
imports.wbg.__wbindgen_closure_wrapper16118 = function(arg0, arg1, arg2) {
|
|
4413
|
+
const ret = makeMutClosure(arg0, arg1, 5109, __wbg_adapter_62);
|
|
4414
|
+
return ret;
|
|
4415
|
+
};
|
|
4416
|
+
imports.wbg.__wbindgen_closure_wrapper16272 = function(arg0, arg1, arg2) {
|
|
4417
|
+
const ret = makeMutClosure(arg0, arg1, 5157, __wbg_adapter_65);
|
|
4418
|
+
return ret;
|
|
4419
|
+
};
|
|
4420
|
+
imports.wbg.__wbindgen_closure_wrapper7181 = function(arg0, arg1, arg2) {
|
|
4421
|
+
const ret = makeMutClosure(arg0, arg1, 2400, __wbg_adapter_56);
|
|
4422
|
+
return ret;
|
|
4423
|
+
};
|
|
4424
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
4425
|
+
const ret = debugString(arg1);
|
|
4426
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4427
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4428
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4429
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4430
|
+
};
|
|
4431
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
4432
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
4433
|
+
return ret;
|
|
4434
|
+
};
|
|
4435
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
4436
|
+
const ret = arg0 in arg1;
|
|
4437
|
+
return ret;
|
|
4438
|
+
};
|
|
4439
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
4440
|
+
const table = wasm.__wbindgen_export_4;
|
|
4441
|
+
const offset = table.grow(4);
|
|
4442
|
+
table.set(0, undefined);
|
|
4443
|
+
table.set(offset + 0, undefined);
|
|
4444
|
+
table.set(offset + 1, null);
|
|
4445
|
+
table.set(offset + 2, true);
|
|
4446
|
+
table.set(offset + 3, false);
|
|
4447
|
+
;
|
|
4448
|
+
};
|
|
4449
|
+
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
4450
|
+
const ret = typeof(arg0) === 'bigint';
|
|
4451
|
+
return ret;
|
|
4452
|
+
};
|
|
4453
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
4454
|
+
const ret = typeof(arg0) === 'function';
|
|
4455
|
+
return ret;
|
|
4456
|
+
};
|
|
4457
|
+
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
4458
|
+
const ret = arg0 === null;
|
|
4459
|
+
return ret;
|
|
4460
|
+
};
|
|
4461
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
4462
|
+
const val = arg0;
|
|
4463
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
4464
|
+
return ret;
|
|
4465
|
+
};
|
|
4466
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
4467
|
+
const ret = typeof(arg0) === 'string';
|
|
4468
|
+
return ret;
|
|
4469
|
+
};
|
|
4470
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
4471
|
+
const ret = arg0 === undefined;
|
|
4472
|
+
return ret;
|
|
4473
|
+
};
|
|
4474
|
+
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
4475
|
+
const ret = arg0 === arg1;
|
|
4476
|
+
return ret;
|
|
4477
|
+
};
|
|
4478
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
4479
|
+
const ret = arg0 == arg1;
|
|
4480
|
+
return ret;
|
|
4481
|
+
};
|
|
4482
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
4483
|
+
const ret = wasm.memory;
|
|
4484
|
+
return ret;
|
|
4485
|
+
};
|
|
4486
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
4487
|
+
const obj = arg1;
|
|
4488
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
4489
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
4490
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
4491
|
+
};
|
|
4492
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
4493
|
+
const ret = arg0;
|
|
4494
|
+
return ret;
|
|
4495
|
+
};
|
|
4496
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
4497
|
+
const obj = arg1;
|
|
4498
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
4499
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
4500
|
+
var len1 = WASM_VECTOR_LEN;
|
|
4501
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4502
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4503
|
+
};
|
|
4504
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
4505
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
4506
|
+
return ret;
|
|
4507
|
+
};
|
|
4508
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
4509
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
4510
|
+
};
|
|
4511
|
+
|
|
4512
|
+
return imports;
|
|
4513
|
+
}
|
|
4514
|
+
|
|
4515
|
+
function __wbg_init_memory(imports, memory) {
|
|
4516
|
+
|
|
4517
|
+
}
|
|
4518
|
+
|
|
4519
|
+
function __wbg_finalize_init(instance, module) {
|
|
4520
|
+
wasm = instance.exports;
|
|
4521
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
4522
|
+
cachedDataViewMemory0 = null;
|
|
4523
|
+
cachedUint32ArrayMemory0 = null;
|
|
4524
|
+
cachedUint8ArrayMemory0 = null;
|
|
4525
|
+
|
|
4526
|
+
|
|
4527
|
+
wasm.__wbindgen_start();
|
|
4528
|
+
return wasm;
|
|
4529
|
+
}
|
|
4530
|
+
|
|
4531
|
+
function initSync(module) {
|
|
4532
|
+
if (wasm !== undefined) return wasm;
|
|
4533
|
+
|
|
4534
|
+
|
|
4535
|
+
if (typeof module !== 'undefined') {
|
|
4536
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
4537
|
+
({module} = module)
|
|
4538
|
+
} else {
|
|
4539
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
4540
|
+
}
|
|
4541
|
+
}
|
|
4542
|
+
|
|
4543
|
+
const imports = __wbg_get_imports();
|
|
4544
|
+
|
|
4545
|
+
__wbg_init_memory(imports);
|
|
4546
|
+
|
|
4547
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
4548
|
+
module = new WebAssembly.Module(module);
|
|
4549
|
+
}
|
|
4550
|
+
|
|
4551
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
4552
|
+
|
|
4553
|
+
return __wbg_finalize_init(instance, module);
|
|
4554
|
+
}
|
|
4555
|
+
|
|
4556
|
+
async function __wbg_init(module_or_path) {
|
|
4557
|
+
if (wasm !== undefined) return wasm;
|
|
4558
|
+
|
|
4559
|
+
|
|
4560
|
+
if (typeof module_or_path !== 'undefined') {
|
|
4561
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
4562
|
+
({module_or_path} = module_or_path)
|
|
4563
|
+
} else {
|
|
4564
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
4565
|
+
}
|
|
4566
|
+
}
|
|
4567
|
+
|
|
4568
|
+
if (typeof module_or_path === 'undefined') {
|
|
4569
|
+
module_or_path = new URL('wasm_sdk_bg.wasm', import.meta.url);
|
|
4570
|
+
}
|
|
4571
|
+
const imports = __wbg_get_imports();
|
|
4572
|
+
|
|
4573
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
4574
|
+
module_or_path = fetch(module_or_path);
|
|
4575
|
+
}
|
|
4576
|
+
|
|
4577
|
+
__wbg_init_memory(imports);
|
|
4578
|
+
|
|
4579
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
4580
|
+
|
|
4581
|
+
return __wbg_finalize_init(instance, module);
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4584
|
+
export { initSync };
|
|
4585
|
+
export default __wbg_init;
|