@sovereign-sdk/universal-wallet-wasm 0.4.0 → 0.6.0
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 +1 -1
- package/dist/esm/README.md +1 -1
- package/dist/esm/wallet_wasm.d.ts +40 -47
- package/dist/esm/wallet_wasm.js +2 -2
- package/dist/esm/wallet_wasm_bg.js +140 -171
- package/dist/esm/wallet_wasm_bg.wasm +0 -0
- package/dist/esm/wallet_wasm_bg.wasm.d.ts +16 -12
- package/dist/node/README.md +1 -1
- package/dist/node/wallet_wasm.d.ts +40 -47
- package/dist/node/wallet_wasm.js +142 -171
- package/dist/node/wallet_wasm_bg.wasm +0 -0
- package/dist/node/wallet_wasm_bg.wasm.d.ts +16 -12
- package/package.json +4 -4
- package/LICENSE +0 -201
|
@@ -1,65 +1,58 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* Well-known ids of types utilized in the rollup.
|
|
5
|
-
*/
|
|
4
|
+
* Well-known ids of types utilized in the rollup.
|
|
5
|
+
*/
|
|
6
6
|
export enum KnownTypeId {
|
|
7
|
-
/**
|
|
8
|
-
* The type id of the transaction.
|
|
9
|
-
*/
|
|
7
|
+
/**
|
|
8
|
+
* The type id of the transaction.
|
|
9
|
+
*/
|
|
10
10
|
Transaction = 0,
|
|
11
|
-
/**
|
|
12
|
-
* The type id of the unsigned transaction.
|
|
13
|
-
*/
|
|
11
|
+
/**
|
|
12
|
+
* The type id of the unsigned transaction.
|
|
13
|
+
*/
|
|
14
14
|
UnsignedTransaction = 1,
|
|
15
|
-
/**
|
|
16
|
-
* The type id of the runtime call.
|
|
17
|
-
*/
|
|
15
|
+
/**
|
|
16
|
+
* The type id of the runtime call.
|
|
17
|
+
*/
|
|
18
18
|
RuntimeCall = 2,
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* A rollup schema is a description of the types that are utilized in the rollup.
|
|
22
|
-
* It is used to serialize and deserialize the types.
|
|
23
|
-
* As well as display them in a human-readable way that is verified by the rollup.
|
|
24
|
-
*/
|
|
21
|
+
* A rollup schema is a description of the types that are utilized in the rollup.
|
|
22
|
+
* It is used to serialize and deserialize the types.
|
|
23
|
+
* As well as display them in a human-readable way that is verified by the rollup.
|
|
24
|
+
*/
|
|
25
25
|
export class Schema {
|
|
26
|
+
private constructor();
|
|
26
27
|
free(): void;
|
|
27
|
-
/**
|
|
28
|
-
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
29
|
-
|
|
30
|
-
* @returns {Schema}
|
|
31
|
-
*/
|
|
28
|
+
/**
|
|
29
|
+
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
30
|
+
*/
|
|
32
31
|
static fromJSON(json: string): Schema;
|
|
33
|
-
/**
|
|
34
|
-
* Converts the provided JSON to borsh according to the provided schema.
|
|
35
|
-
|
|
36
|
-
* @param {string} input
|
|
37
|
-
* @returns {Uint8Array}
|
|
38
|
-
*/
|
|
32
|
+
/**
|
|
33
|
+
* Converts the provided JSON to borsh according to the provided schema.
|
|
34
|
+
*/
|
|
39
35
|
jsonToBorsh(type_index: number, input: string): Uint8Array;
|
|
40
|
-
/**
|
|
41
|
-
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
42
|
-
|
|
43
|
-
* @param {Uint8Array} input
|
|
44
|
-
* @returns {string}
|
|
45
|
-
*/
|
|
36
|
+
/**
|
|
37
|
+
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
38
|
+
*/
|
|
46
39
|
display(type_index: number, input: Uint8Array): string;
|
|
47
|
-
/**
|
|
48
|
-
* Get the index of the provided known type within the schema.
|
|
49
|
-
|
|
50
|
-
* @returns {number}
|
|
51
|
-
*/
|
|
40
|
+
/**
|
|
41
|
+
* Get the index of the provided known type within the schema.
|
|
42
|
+
*/
|
|
52
43
|
knownTypeIndex(known_type_id: KnownTypeId): number;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* Returns the JSON descriptor that was used to create this schema instance.
|
|
59
|
-
*/
|
|
44
|
+
eip712Json(type_index: number, input: Uint8Array): string;
|
|
45
|
+
eip712SigningHash(type_index: number, input: Uint8Array): Uint8Array;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the JSON descriptor that was used to create this schema instance.
|
|
48
|
+
*/
|
|
60
49
|
readonly descriptor: string;
|
|
61
|
-
/**
|
|
62
|
-
* Get the metadata hash from the schema.
|
|
63
|
-
*/
|
|
50
|
+
/**
|
|
51
|
+
* Get the metadata hash from the schema.
|
|
52
|
+
*/
|
|
64
53
|
readonly metadataHash: Uint8Array;
|
|
54
|
+
/**
|
|
55
|
+
* Get the chain hash from the schema.
|
|
56
|
+
*/
|
|
57
|
+
readonly chainHash: Uint8Array;
|
|
65
58
|
}
|
package/dist/node/wallet_wasm.js
CHANGED
|
@@ -22,21 +22,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
22
22
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const heap = new Array(128).fill(undefined);
|
|
26
|
-
|
|
27
|
-
heap.push(undefined, null, true, false);
|
|
28
|
-
|
|
29
|
-
let heap_next = heap.length;
|
|
30
|
-
|
|
31
|
-
function addHeapObject(obj) {
|
|
32
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
33
|
-
const idx = heap_next;
|
|
34
|
-
heap_next = heap[idx];
|
|
35
|
-
|
|
36
|
-
heap[idx] = obj;
|
|
37
|
-
return idx;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
25
|
let WASM_VECTOR_LEN = 0;
|
|
41
26
|
|
|
42
27
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -93,27 +78,10 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
93
78
|
return ptr;
|
|
94
79
|
}
|
|
95
80
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
101
|
-
}
|
|
102
|
-
return cachedDataViewMemory0;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function getObject(idx) { return heap[idx]; }
|
|
106
|
-
|
|
107
|
-
function dropObject(idx) {
|
|
108
|
-
if (idx < 132) return;
|
|
109
|
-
heap[idx] = heap_next;
|
|
110
|
-
heap_next = idx;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
function takeObject(idx) {
|
|
114
|
-
const ret = getObject(idx);
|
|
115
|
-
dropObject(idx);
|
|
116
|
-
return ret;
|
|
81
|
+
function takeFromExternrefTable0(idx) {
|
|
82
|
+
const value = wasm.__wbindgen_export_0.get(idx);
|
|
83
|
+
wasm.__externref_table_dealloc(idx);
|
|
84
|
+
return value;
|
|
117
85
|
}
|
|
118
86
|
|
|
119
87
|
function getArrayU8FromWasm0(ptr, len) {
|
|
@@ -128,30 +96,32 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
128
96
|
return ptr;
|
|
129
97
|
}
|
|
130
98
|
/**
|
|
131
|
-
* Well-known ids of types utilized in the rollup.
|
|
132
|
-
|
|
99
|
+
* Well-known ids of types utilized in the rollup.
|
|
100
|
+
* @enum {0 | 1 | 2}
|
|
101
|
+
*/
|
|
133
102
|
module.exports.KnownTypeId = Object.freeze({
|
|
134
|
-
/**
|
|
135
|
-
* The type id of the transaction.
|
|
136
|
-
*/
|
|
137
|
-
Transaction:0,"0":"Transaction",
|
|
138
|
-
/**
|
|
139
|
-
* The type id of the unsigned transaction.
|
|
140
|
-
*/
|
|
141
|
-
UnsignedTransaction:1,"1":"UnsignedTransaction",
|
|
142
|
-
/**
|
|
143
|
-
* The type id of the runtime call.
|
|
144
|
-
*/
|
|
145
|
-
RuntimeCall:2,"2":"RuntimeCall",
|
|
103
|
+
/**
|
|
104
|
+
* The type id of the transaction.
|
|
105
|
+
*/
|
|
106
|
+
Transaction: 0, "0": "Transaction",
|
|
107
|
+
/**
|
|
108
|
+
* The type id of the unsigned transaction.
|
|
109
|
+
*/
|
|
110
|
+
UnsignedTransaction: 1, "1": "UnsignedTransaction",
|
|
111
|
+
/**
|
|
112
|
+
* The type id of the runtime call.
|
|
113
|
+
*/
|
|
114
|
+
RuntimeCall: 2, "2": "RuntimeCall",
|
|
115
|
+
});
|
|
146
116
|
|
|
147
117
|
const SchemaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
148
118
|
? { register: () => {}, unregister: () => {} }
|
|
149
119
|
: new FinalizationRegistry(ptr => wasm.__wbg_schema_free(ptr >>> 0, 1));
|
|
150
120
|
/**
|
|
151
|
-
* A rollup schema is a description of the types that are utilized in the rollup.
|
|
152
|
-
* It is used to serialize and deserialize the types.
|
|
153
|
-
* As well as display them in a human-readable way that is verified by the rollup.
|
|
154
|
-
*/
|
|
121
|
+
* A rollup schema is a description of the types that are utilized in the rollup.
|
|
122
|
+
* It is used to serialize and deserialize the types.
|
|
123
|
+
* As well as display them in a human-readable way that is verified by the rollup.
|
|
124
|
+
*/
|
|
155
125
|
class Schema {
|
|
156
126
|
|
|
157
127
|
static __wrap(ptr) {
|
|
@@ -174,175 +144,174 @@ class Schema {
|
|
|
174
144
|
wasm.__wbg_schema_free(ptr, 0);
|
|
175
145
|
}
|
|
176
146
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
147
|
+
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
148
|
+
* @param {string} json
|
|
149
|
+
* @returns {Schema}
|
|
150
|
+
*/
|
|
181
151
|
static fromJSON(json) {
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
188
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
189
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
190
|
-
if (r2) {
|
|
191
|
-
throw takeObject(r1);
|
|
192
|
-
}
|
|
193
|
-
return Schema.__wrap(r0);
|
|
194
|
-
} finally {
|
|
195
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
152
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
153
|
+
const len0 = WASM_VECTOR_LEN;
|
|
154
|
+
const ret = wasm.schema_fromJSON(ptr0, len0);
|
|
155
|
+
if (ret[2]) {
|
|
156
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
196
157
|
}
|
|
158
|
+
return Schema.__wrap(ret[0]);
|
|
197
159
|
}
|
|
198
160
|
/**
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
161
|
+
* Returns the JSON descriptor that was used to create this schema instance.
|
|
162
|
+
* @returns {string}
|
|
163
|
+
*/
|
|
202
164
|
get descriptor() {
|
|
203
165
|
let deferred1_0;
|
|
204
166
|
let deferred1_1;
|
|
205
167
|
try {
|
|
206
|
-
const
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
deferred1_0 = r0;
|
|
211
|
-
deferred1_1 = r1;
|
|
212
|
-
return getStringFromWasm0(r0, r1);
|
|
168
|
+
const ret = wasm.schema_descriptor(this.__wbg_ptr);
|
|
169
|
+
deferred1_0 = ret[0];
|
|
170
|
+
deferred1_1 = ret[1];
|
|
171
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
213
172
|
} finally {
|
|
214
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
215
173
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
216
174
|
}
|
|
217
175
|
}
|
|
218
176
|
/**
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
177
|
+
* Converts the provided JSON to borsh according to the provided schema.
|
|
178
|
+
* @param {number} type_index
|
|
179
|
+
* @param {string} input
|
|
180
|
+
* @returns {Uint8Array}
|
|
181
|
+
*/
|
|
224
182
|
jsonToBorsh(type_index, input) {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
231
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
232
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
233
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
234
|
-
if (r3) {
|
|
235
|
-
throw takeObject(r2);
|
|
236
|
-
}
|
|
237
|
-
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
238
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
239
|
-
return v2;
|
|
240
|
-
} finally {
|
|
241
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
183
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
184
|
+
const len0 = WASM_VECTOR_LEN;
|
|
185
|
+
const ret = wasm.schema_jsonToBorsh(this.__wbg_ptr, type_index, ptr0, len0);
|
|
186
|
+
if (ret[3]) {
|
|
187
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
242
188
|
}
|
|
189
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
190
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
191
|
+
return v2;
|
|
243
192
|
}
|
|
244
193
|
/**
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
194
|
+
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
195
|
+
* @param {number} type_index
|
|
196
|
+
* @param {Uint8Array} input
|
|
197
|
+
* @returns {string}
|
|
198
|
+
*/
|
|
250
199
|
display(type_index, input) {
|
|
251
200
|
let deferred3_0;
|
|
252
201
|
let deferred3_1;
|
|
253
202
|
try {
|
|
254
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
255
203
|
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
256
204
|
const len0 = WASM_VECTOR_LEN;
|
|
257
|
-
wasm.schema_display(
|
|
258
|
-
var
|
|
259
|
-
var
|
|
260
|
-
|
|
261
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
262
|
-
var ptr2 = r0;
|
|
263
|
-
var len2 = r1;
|
|
264
|
-
if (r3) {
|
|
205
|
+
const ret = wasm.schema_display(this.__wbg_ptr, type_index, ptr0, len0);
|
|
206
|
+
var ptr2 = ret[0];
|
|
207
|
+
var len2 = ret[1];
|
|
208
|
+
if (ret[3]) {
|
|
265
209
|
ptr2 = 0; len2 = 0;
|
|
266
|
-
throw
|
|
210
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
267
211
|
}
|
|
268
212
|
deferred3_0 = ptr2;
|
|
269
213
|
deferred3_1 = len2;
|
|
270
214
|
return getStringFromWasm0(ptr2, len2);
|
|
271
215
|
} finally {
|
|
272
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
273
216
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
274
217
|
}
|
|
275
218
|
}
|
|
276
219
|
/**
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
220
|
+
* Get the index of the provided known type within the schema.
|
|
221
|
+
* @param {KnownTypeId} known_type_id
|
|
222
|
+
* @returns {number}
|
|
223
|
+
*/
|
|
281
224
|
knownTypeIndex(known_type_id) {
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
286
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
287
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
288
|
-
if (r2) {
|
|
289
|
-
throw takeObject(r1);
|
|
290
|
-
}
|
|
291
|
-
return r0 >>> 0;
|
|
292
|
-
} finally {
|
|
293
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
225
|
+
const ret = wasm.schema_knownTypeIndex(this.__wbg_ptr, known_type_id);
|
|
226
|
+
if (ret[2]) {
|
|
227
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
294
228
|
}
|
|
229
|
+
return ret[0] >>> 0;
|
|
295
230
|
}
|
|
296
231
|
/**
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
232
|
+
* Get the metadata hash from the schema.
|
|
233
|
+
* @returns {Uint8Array}
|
|
234
|
+
*/
|
|
300
235
|
get metadataHash() {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
305
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
306
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
307
|
-
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
308
|
-
if (r3) {
|
|
309
|
-
throw takeObject(r2);
|
|
310
|
-
}
|
|
311
|
-
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
312
|
-
wasm.__wbindgen_free(r0, r1 * 1, 1);
|
|
313
|
-
return v1;
|
|
314
|
-
} finally {
|
|
315
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
236
|
+
const ret = wasm.schema_metadataHash(this.__wbg_ptr);
|
|
237
|
+
if (ret[3]) {
|
|
238
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
316
239
|
}
|
|
240
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
241
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
242
|
+
return v1;
|
|
317
243
|
}
|
|
318
244
|
/**
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
245
|
+
* Get the chain hash from the schema.
|
|
246
|
+
* @returns {Uint8Array}
|
|
247
|
+
*/
|
|
322
248
|
get chainHash() {
|
|
249
|
+
const ret = wasm.schema_chainHash(this.__wbg_ptr);
|
|
250
|
+
if (ret[3]) {
|
|
251
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
252
|
+
}
|
|
253
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
254
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
255
|
+
return v1;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* @param {number} type_index
|
|
259
|
+
* @param {Uint8Array} input
|
|
260
|
+
* @returns {string}
|
|
261
|
+
*/
|
|
262
|
+
eip712Json(type_index, input) {
|
|
263
|
+
let deferred3_0;
|
|
264
|
+
let deferred3_1;
|
|
323
265
|
try {
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
var
|
|
328
|
-
var
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
throw
|
|
266
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
267
|
+
const len0 = WASM_VECTOR_LEN;
|
|
268
|
+
const ret = wasm.schema_eip712Json(this.__wbg_ptr, type_index, ptr0, len0);
|
|
269
|
+
var ptr2 = ret[0];
|
|
270
|
+
var len2 = ret[1];
|
|
271
|
+
if (ret[3]) {
|
|
272
|
+
ptr2 = 0; len2 = 0;
|
|
273
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
332
274
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
return
|
|
275
|
+
deferred3_0 = ptr2;
|
|
276
|
+
deferred3_1 = len2;
|
|
277
|
+
return getStringFromWasm0(ptr2, len2);
|
|
336
278
|
} finally {
|
|
337
|
-
wasm.
|
|
279
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
338
280
|
}
|
|
339
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* @param {number} type_index
|
|
284
|
+
* @param {Uint8Array} input
|
|
285
|
+
* @returns {Uint8Array}
|
|
286
|
+
*/
|
|
287
|
+
eip712SigningHash(type_index, input) {
|
|
288
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
289
|
+
const len0 = WASM_VECTOR_LEN;
|
|
290
|
+
const ret = wasm.schema_eip712SigningHash(this.__wbg_ptr, type_index, ptr0, len0);
|
|
291
|
+
if (ret[3]) {
|
|
292
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
293
|
+
}
|
|
294
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
295
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
296
|
+
return v2;
|
|
297
|
+
}
|
|
340
298
|
}
|
|
341
299
|
module.exports.Schema = Schema;
|
|
342
300
|
|
|
343
301
|
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
344
302
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
345
|
-
return
|
|
303
|
+
return ret;
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
module.exports.__wbindgen_init_externref_table = function() {
|
|
307
|
+
const table = wasm.__wbindgen_export_0;
|
|
308
|
+
const offset = table.grow(4);
|
|
309
|
+
table.set(0, undefined);
|
|
310
|
+
table.set(offset + 0, undefined);
|
|
311
|
+
table.set(offset + 1, null);
|
|
312
|
+
table.set(offset + 2, true);
|
|
313
|
+
table.set(offset + 3, false);
|
|
314
|
+
;
|
|
346
315
|
};
|
|
347
316
|
|
|
348
317
|
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
@@ -357,3 +326,5 @@ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
|
357
326
|
wasm = wasmInstance.exports;
|
|
358
327
|
module.exports.__wasm = wasm;
|
|
359
328
|
|
|
329
|
+
wasm.__wbindgen_start();
|
|
330
|
+
|
|
Binary file
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
4
|
+
export const __wbg_schema_free: (a: number, b: number) => void;
|
|
5
|
+
export const schema_fromJSON: (a: number, b: number) => [number, number, number];
|
|
6
|
+
export const schema_descriptor: (a: number) => [number, number];
|
|
7
|
+
export const schema_jsonToBorsh: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
8
|
+
export const schema_display: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
9
|
+
export const schema_knownTypeIndex: (a: number, b: number) => [number, number, number];
|
|
10
|
+
export const schema_metadataHash: (a: number) => [number, number, number, number];
|
|
11
|
+
export const schema_chainHash: (a: number) => [number, number, number, number];
|
|
12
|
+
export const schema_eip712Json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
13
|
+
export const schema_eip712SigningHash: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
14
|
+
export const __wbindgen_export_0: WebAssembly.Table;
|
|
15
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
16
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
17
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
18
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
19
|
+
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sovereign-sdk/universal-wallet-wasm",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"repository": "github:Sovereign-Labs/sovereign-sdk
|
|
3
|
+
"version": "0.6.0",
|
|
4
|
+
"repository": "github:Sovereign-Labs/sovereign-sdk",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/**/*",
|
|
7
7
|
"!dist/**/.gitignore",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"types": "dist/node/wallet_wasm.d.ts",
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^22.7.4",
|
|
28
|
-
"vitest": "
|
|
28
|
+
"vitest": "4.0.7",
|
|
29
29
|
"wasm-pack": "^0.13.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"build": "pnpm run compile:node && pnpm run compile:esm && ./scripts/ensure_module_types.sh",
|
|
39
39
|
"compile:esm": "wasm-pack build --target bundler --release --out-dir dist/esm",
|
|
40
40
|
"compile:node": "wasm-pack build --target nodejs --release --out-dir dist/node",
|
|
41
|
-
"test": "
|
|
41
|
+
"test": "vitest run --project unit"
|
|
42
42
|
}
|
|
43
43
|
}
|