@sovereign-sdk/universal-wallet-wasm 0.5.0 → 0.7.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 +12 -12
- package/dist/esm/wallet_wasm_bg.js +74 -74
- package/dist/esm/wallet_wasm_bg.wasm +0 -0
- package/dist/esm/wallet_wasm_bg.wasm.d.ts +7 -7
- package/dist/node/README.md +1 -1
- package/dist/node/wallet_wasm.d.ts +12 -12
- package/dist/node/wallet_wasm.js +74 -74
- package/dist/node/wallet_wasm_bg.wasm +0 -0
- package/dist/node/wallet_wasm_bg.wasm.d.ts +7 -7
- package/package.json +7 -4
- package/LICENSE +0 -201
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @sovereign-sdk/universal-wallet-wasm
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@sovereign-sdk/universal-wallet-wasm)
|
|
4
|
-
[](https://github.com/Sovereign-Labs/sovereign-sdk/actions/workflows/typescript.ci.yml)
|
|
5
5
|
|
|
6
6
|
WebAssembly bindings for Sovereign SDK's universal wallet, providing schema validation and serialization utilities.
|
|
7
7
|
|
package/dist/esm/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @sovereign-sdk/universal-wallet-wasm
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@sovereign-sdk/universal-wallet-wasm)
|
|
4
|
-
[](https://github.com/Sovereign-Labs/sovereign-sdk/actions/workflows/typescript.ci.yml)
|
|
5
5
|
|
|
6
6
|
WebAssembly bindings for Sovereign SDK's universal wallet, providing schema validation and serialization utilities.
|
|
7
7
|
|
|
@@ -25,24 +25,28 @@ export enum KnownTypeId {
|
|
|
25
25
|
export class Schema {
|
|
26
26
|
private constructor();
|
|
27
27
|
free(): void;
|
|
28
|
-
|
|
29
|
-
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
30
|
-
*/
|
|
31
|
-
static fromJSON(json: string): Schema;
|
|
28
|
+
eip712Json(type_index: number, input: Uint8Array): string;
|
|
32
29
|
/**
|
|
33
30
|
* Converts the provided JSON to borsh according to the provided schema.
|
|
34
31
|
*/
|
|
35
32
|
jsonToBorsh(type_index: number, input: string): Uint8Array;
|
|
33
|
+
/**
|
|
34
|
+
* Get the index of the provided known type within the schema.
|
|
35
|
+
*/
|
|
36
|
+
knownTypeIndex(known_type_id: KnownTypeId): number;
|
|
37
|
+
eip712SigningHash(type_index: number, input: Uint8Array): Uint8Array;
|
|
36
38
|
/**
|
|
37
39
|
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
38
40
|
*/
|
|
39
41
|
display(type_index: number, input: Uint8Array): string;
|
|
40
42
|
/**
|
|
41
|
-
*
|
|
43
|
+
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
42
44
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
static fromJSON(json: string): Schema;
|
|
46
|
+
/**
|
|
47
|
+
* Get the chain hash from the schema.
|
|
48
|
+
*/
|
|
49
|
+
readonly chainHash: Uint8Array;
|
|
46
50
|
/**
|
|
47
51
|
* Returns the JSON descriptor that was used to create this schema instance.
|
|
48
52
|
*/
|
|
@@ -51,8 +55,4 @@ export class Schema {
|
|
|
51
55
|
* Get the metadata hash from the schema.
|
|
52
56
|
*/
|
|
53
57
|
readonly metadataHash: Uint8Array;
|
|
54
|
-
/**
|
|
55
|
-
* Get the chain hash from the schema.
|
|
56
|
-
*/
|
|
57
|
-
readonly chainHash: Uint8Array;
|
|
58
58
|
}
|
|
@@ -24,8 +24,26 @@ function getStringFromWasm0(ptr, len) {
|
|
|
24
24
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
function takeFromExternrefTable0(idx) {
|
|
28
|
+
const value = wasm.__wbindgen_export_0.get(idx);
|
|
29
|
+
wasm.__externref_table_dealloc(idx);
|
|
30
|
+
return value;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
34
|
+
ptr = ptr >>> 0;
|
|
35
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
36
|
+
}
|
|
37
|
+
|
|
27
38
|
let WASM_VECTOR_LEN = 0;
|
|
28
39
|
|
|
40
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
41
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
42
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
43
|
+
WASM_VECTOR_LEN = arg.length;
|
|
44
|
+
return ptr;
|
|
45
|
+
}
|
|
46
|
+
|
|
29
47
|
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
30
48
|
|
|
31
49
|
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
@@ -81,24 +99,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
81
99
|
WASM_VECTOR_LEN = offset;
|
|
82
100
|
return ptr;
|
|
83
101
|
}
|
|
84
|
-
|
|
85
|
-
function takeFromExternrefTable0(idx) {
|
|
86
|
-
const value = wasm.__wbindgen_export_0.get(idx);
|
|
87
|
-
wasm.__externref_table_dealloc(idx);
|
|
88
|
-
return value;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
92
|
-
ptr = ptr >>> 0;
|
|
93
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
97
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
98
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
99
|
-
WASM_VECTOR_LEN = arg.length;
|
|
100
|
-
return ptr;
|
|
101
|
-
}
|
|
102
102
|
/**
|
|
103
103
|
* Well-known ids of types utilized in the rollup.
|
|
104
104
|
* @enum {0 | 1 | 2}
|
|
@@ -148,18 +148,17 @@ export class Schema {
|
|
|
148
148
|
wasm.__wbg_schema_free(ptr, 0);
|
|
149
149
|
}
|
|
150
150
|
/**
|
|
151
|
-
*
|
|
152
|
-
* @
|
|
153
|
-
* @returns {Schema}
|
|
151
|
+
* Get the chain hash from the schema.
|
|
152
|
+
* @returns {Uint8Array}
|
|
154
153
|
*/
|
|
155
|
-
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (ret[2]) {
|
|
160
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
154
|
+
get chainHash() {
|
|
155
|
+
const ret = wasm.schema_chainHash(this.__wbg_ptr);
|
|
156
|
+
if (ret[3]) {
|
|
157
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
161
158
|
}
|
|
162
|
-
|
|
159
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
160
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
161
|
+
return v1;
|
|
163
162
|
}
|
|
164
163
|
/**
|
|
165
164
|
* Returns the JSON descriptor that was used to create this schema instance.
|
|
@@ -178,35 +177,17 @@ export class Schema {
|
|
|
178
177
|
}
|
|
179
178
|
}
|
|
180
179
|
/**
|
|
181
|
-
* Converts the provided JSON to borsh according to the provided schema.
|
|
182
|
-
* @param {number} type_index
|
|
183
|
-
* @param {string} input
|
|
184
|
-
* @returns {Uint8Array}
|
|
185
|
-
*/
|
|
186
|
-
jsonToBorsh(type_index, input) {
|
|
187
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
188
|
-
const len0 = WASM_VECTOR_LEN;
|
|
189
|
-
const ret = wasm.schema_jsonToBorsh(this.__wbg_ptr, type_index, ptr0, len0);
|
|
190
|
-
if (ret[3]) {
|
|
191
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
192
|
-
}
|
|
193
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
194
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
195
|
-
return v2;
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
199
180
|
* @param {number} type_index
|
|
200
181
|
* @param {Uint8Array} input
|
|
201
182
|
* @returns {string}
|
|
202
183
|
*/
|
|
203
|
-
|
|
184
|
+
eip712Json(type_index, input) {
|
|
204
185
|
let deferred3_0;
|
|
205
186
|
let deferred3_1;
|
|
206
187
|
try {
|
|
207
188
|
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
208
189
|
const len0 = WASM_VECTOR_LEN;
|
|
209
|
-
const ret = wasm.
|
|
190
|
+
const ret = wasm.schema_eip712Json(this.__wbg_ptr, type_index, ptr0, len0);
|
|
210
191
|
var ptr2 = ret[0];
|
|
211
192
|
var len2 = ret[1];
|
|
212
193
|
if (ret[3]) {
|
|
@@ -221,16 +202,21 @@ export class Schema {
|
|
|
221
202
|
}
|
|
222
203
|
}
|
|
223
204
|
/**
|
|
224
|
-
*
|
|
225
|
-
* @param {
|
|
226
|
-
* @
|
|
205
|
+
* Converts the provided JSON to borsh according to the provided schema.
|
|
206
|
+
* @param {number} type_index
|
|
207
|
+
* @param {string} input
|
|
208
|
+
* @returns {Uint8Array}
|
|
227
209
|
*/
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
210
|
+
jsonToBorsh(type_index, input) {
|
|
211
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
212
|
+
const len0 = WASM_VECTOR_LEN;
|
|
213
|
+
const ret = wasm.schema_jsonToBorsh(this.__wbg_ptr, type_index, ptr0, len0);
|
|
214
|
+
if (ret[3]) {
|
|
215
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
232
216
|
}
|
|
233
|
-
|
|
217
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
218
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
219
|
+
return v2;
|
|
234
220
|
}
|
|
235
221
|
/**
|
|
236
222
|
* Get the metadata hash from the schema.
|
|
@@ -246,30 +232,46 @@ export class Schema {
|
|
|
246
232
|
return v1;
|
|
247
233
|
}
|
|
248
234
|
/**
|
|
249
|
-
* Get the
|
|
235
|
+
* Get the index of the provided known type within the schema.
|
|
236
|
+
* @param {KnownTypeId} known_type_id
|
|
237
|
+
* @returns {number}
|
|
238
|
+
*/
|
|
239
|
+
knownTypeIndex(known_type_id) {
|
|
240
|
+
const ret = wasm.schema_knownTypeIndex(this.__wbg_ptr, known_type_id);
|
|
241
|
+
if (ret[2]) {
|
|
242
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
243
|
+
}
|
|
244
|
+
return ret[0] >>> 0;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* @param {number} type_index
|
|
248
|
+
* @param {Uint8Array} input
|
|
250
249
|
* @returns {Uint8Array}
|
|
251
250
|
*/
|
|
252
|
-
|
|
253
|
-
const
|
|
251
|
+
eip712SigningHash(type_index, input) {
|
|
252
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
253
|
+
const len0 = WASM_VECTOR_LEN;
|
|
254
|
+
const ret = wasm.schema_eip712SigningHash(this.__wbg_ptr, type_index, ptr0, len0);
|
|
254
255
|
if (ret[3]) {
|
|
255
256
|
throw takeFromExternrefTable0(ret[2]);
|
|
256
257
|
}
|
|
257
|
-
var
|
|
258
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
258
259
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
259
|
-
return
|
|
260
|
+
return v2;
|
|
260
261
|
}
|
|
261
262
|
/**
|
|
263
|
+
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
262
264
|
* @param {number} type_index
|
|
263
265
|
* @param {Uint8Array} input
|
|
264
266
|
* @returns {string}
|
|
265
267
|
*/
|
|
266
|
-
|
|
268
|
+
display(type_index, input) {
|
|
267
269
|
let deferred3_0;
|
|
268
270
|
let deferred3_1;
|
|
269
271
|
try {
|
|
270
272
|
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
271
273
|
const len0 = WASM_VECTOR_LEN;
|
|
272
|
-
const ret = wasm.
|
|
274
|
+
const ret = wasm.schema_display(this.__wbg_ptr, type_index, ptr0, len0);
|
|
273
275
|
var ptr2 = ret[0];
|
|
274
276
|
var len2 = ret[1];
|
|
275
277
|
if (ret[3]) {
|
|
@@ -284,20 +286,18 @@ export class Schema {
|
|
|
284
286
|
}
|
|
285
287
|
}
|
|
286
288
|
/**
|
|
287
|
-
*
|
|
288
|
-
* @param {
|
|
289
|
-
* @returns {
|
|
289
|
+
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
290
|
+
* @param {string} json
|
|
291
|
+
* @returns {Schema}
|
|
290
292
|
*/
|
|
291
|
-
|
|
292
|
-
const ptr0 =
|
|
293
|
+
static fromJSON(json) {
|
|
294
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
293
295
|
const len0 = WASM_VECTOR_LEN;
|
|
294
|
-
const ret = wasm.
|
|
295
|
-
if (ret[
|
|
296
|
-
throw takeFromExternrefTable0(ret[
|
|
296
|
+
const ret = wasm.schema_fromJSON(ptr0, len0);
|
|
297
|
+
if (ret[2]) {
|
|
298
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
297
299
|
}
|
|
298
|
-
|
|
299
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
300
|
-
return v2;
|
|
300
|
+
return Schema.__wrap(ret[0]);
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
|
|
Binary file
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_schema_free: (a: number, b: number) => void;
|
|
5
|
-
export const
|
|
5
|
+
export const schema_chainHash: (a: number) => [number, number, number, number];
|
|
6
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
7
|
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
8
|
export const schema_eip712Json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
13
9
|
export const schema_eip712SigningHash: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
10
|
+
export const schema_fromJSON: (a: number, b: number) => [number, number, number];
|
|
11
|
+
export const schema_jsonToBorsh: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
12
|
+
export const schema_knownTypeIndex: (a: number, b: number) => [number, number, number];
|
|
13
|
+
export const schema_metadataHash: (a: number) => [number, number, number, number];
|
|
14
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
15
|
export const __externref_table_dealloc: (a: number) => void;
|
|
18
16
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
17
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
18
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
19
19
|
export const __wbindgen_start: () => void;
|
package/dist/node/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @sovereign-sdk/universal-wallet-wasm
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@sovereign-sdk/universal-wallet-wasm)
|
|
4
|
-
[](https://github.com/Sovereign-Labs/sovereign-sdk/actions/workflows/typescript.ci.yml)
|
|
5
5
|
|
|
6
6
|
WebAssembly bindings for Sovereign SDK's universal wallet, providing schema validation and serialization utilities.
|
|
7
7
|
|
|
@@ -25,24 +25,28 @@ export enum KnownTypeId {
|
|
|
25
25
|
export class Schema {
|
|
26
26
|
private constructor();
|
|
27
27
|
free(): void;
|
|
28
|
-
|
|
29
|
-
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
30
|
-
*/
|
|
31
|
-
static fromJSON(json: string): Schema;
|
|
28
|
+
eip712Json(type_index: number, input: Uint8Array): string;
|
|
32
29
|
/**
|
|
33
30
|
* Converts the provided JSON to borsh according to the provided schema.
|
|
34
31
|
*/
|
|
35
32
|
jsonToBorsh(type_index: number, input: string): Uint8Array;
|
|
33
|
+
/**
|
|
34
|
+
* Get the index of the provided known type within the schema.
|
|
35
|
+
*/
|
|
36
|
+
knownTypeIndex(known_type_id: KnownTypeId): number;
|
|
37
|
+
eip712SigningHash(type_index: number, input: Uint8Array): Uint8Array;
|
|
36
38
|
/**
|
|
37
39
|
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
38
40
|
*/
|
|
39
41
|
display(type_index: number, input: Uint8Array): string;
|
|
40
42
|
/**
|
|
41
|
-
*
|
|
43
|
+
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
42
44
|
*/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
static fromJSON(json: string): Schema;
|
|
46
|
+
/**
|
|
47
|
+
* Get the chain hash from the schema.
|
|
48
|
+
*/
|
|
49
|
+
readonly chainHash: Uint8Array;
|
|
46
50
|
/**
|
|
47
51
|
* Returns the JSON descriptor that was used to create this schema instance.
|
|
48
52
|
*/
|
|
@@ -51,8 +55,4 @@ export class Schema {
|
|
|
51
55
|
* Get the metadata hash from the schema.
|
|
52
56
|
*/
|
|
53
57
|
readonly metadataHash: Uint8Array;
|
|
54
|
-
/**
|
|
55
|
-
* Get the chain hash from the schema.
|
|
56
|
-
*/
|
|
57
|
-
readonly chainHash: Uint8Array;
|
|
58
58
|
}
|
package/dist/node/wallet_wasm.js
CHANGED
|
@@ -22,8 +22,26 @@ function getStringFromWasm0(ptr, len) {
|
|
|
22
22
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
function takeFromExternrefTable0(idx) {
|
|
26
|
+
const value = wasm.__wbindgen_export_0.get(idx);
|
|
27
|
+
wasm.__externref_table_dealloc(idx);
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
32
|
+
ptr = ptr >>> 0;
|
|
33
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
34
|
+
}
|
|
35
|
+
|
|
25
36
|
let WASM_VECTOR_LEN = 0;
|
|
26
37
|
|
|
38
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
39
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
40
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
41
|
+
WASM_VECTOR_LEN = arg.length;
|
|
42
|
+
return ptr;
|
|
43
|
+
}
|
|
44
|
+
|
|
27
45
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
28
46
|
|
|
29
47
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -77,24 +95,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
77
95
|
WASM_VECTOR_LEN = offset;
|
|
78
96
|
return ptr;
|
|
79
97
|
}
|
|
80
|
-
|
|
81
|
-
function takeFromExternrefTable0(idx) {
|
|
82
|
-
const value = wasm.__wbindgen_export_0.get(idx);
|
|
83
|
-
wasm.__externref_table_dealloc(idx);
|
|
84
|
-
return value;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
88
|
-
ptr = ptr >>> 0;
|
|
89
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
93
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
94
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
95
|
-
WASM_VECTOR_LEN = arg.length;
|
|
96
|
-
return ptr;
|
|
97
|
-
}
|
|
98
98
|
/**
|
|
99
99
|
* Well-known ids of types utilized in the rollup.
|
|
100
100
|
* @enum {0 | 1 | 2}
|
|
@@ -144,18 +144,17 @@ class Schema {
|
|
|
144
144
|
wasm.__wbg_schema_free(ptr, 0);
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
|
-
*
|
|
148
|
-
* @
|
|
149
|
-
* @returns {Schema}
|
|
147
|
+
* Get the chain hash from the schema.
|
|
148
|
+
* @returns {Uint8Array}
|
|
150
149
|
*/
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (ret[2]) {
|
|
156
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
150
|
+
get chainHash() {
|
|
151
|
+
const ret = wasm.schema_chainHash(this.__wbg_ptr);
|
|
152
|
+
if (ret[3]) {
|
|
153
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
157
154
|
}
|
|
158
|
-
|
|
155
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
156
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
157
|
+
return v1;
|
|
159
158
|
}
|
|
160
159
|
/**
|
|
161
160
|
* Returns the JSON descriptor that was used to create this schema instance.
|
|
@@ -174,35 +173,17 @@ class Schema {
|
|
|
174
173
|
}
|
|
175
174
|
}
|
|
176
175
|
/**
|
|
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
|
-
*/
|
|
182
|
-
jsonToBorsh(type_index, input) {
|
|
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]);
|
|
188
|
-
}
|
|
189
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
190
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
191
|
-
return v2;
|
|
192
|
-
}
|
|
193
|
-
/**
|
|
194
|
-
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
195
176
|
* @param {number} type_index
|
|
196
177
|
* @param {Uint8Array} input
|
|
197
178
|
* @returns {string}
|
|
198
179
|
*/
|
|
199
|
-
|
|
180
|
+
eip712Json(type_index, input) {
|
|
200
181
|
let deferred3_0;
|
|
201
182
|
let deferred3_1;
|
|
202
183
|
try {
|
|
203
184
|
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
204
185
|
const len0 = WASM_VECTOR_LEN;
|
|
205
|
-
const ret = wasm.
|
|
186
|
+
const ret = wasm.schema_eip712Json(this.__wbg_ptr, type_index, ptr0, len0);
|
|
206
187
|
var ptr2 = ret[0];
|
|
207
188
|
var len2 = ret[1];
|
|
208
189
|
if (ret[3]) {
|
|
@@ -217,16 +198,21 @@ class Schema {
|
|
|
217
198
|
}
|
|
218
199
|
}
|
|
219
200
|
/**
|
|
220
|
-
*
|
|
221
|
-
* @param {
|
|
222
|
-
* @
|
|
201
|
+
* Converts the provided JSON to borsh according to the provided schema.
|
|
202
|
+
* @param {number} type_index
|
|
203
|
+
* @param {string} input
|
|
204
|
+
* @returns {Uint8Array}
|
|
223
205
|
*/
|
|
224
|
-
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
206
|
+
jsonToBorsh(type_index, input) {
|
|
207
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
208
|
+
const len0 = WASM_VECTOR_LEN;
|
|
209
|
+
const ret = wasm.schema_jsonToBorsh(this.__wbg_ptr, type_index, ptr0, len0);
|
|
210
|
+
if (ret[3]) {
|
|
211
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
228
212
|
}
|
|
229
|
-
|
|
213
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
214
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
215
|
+
return v2;
|
|
230
216
|
}
|
|
231
217
|
/**
|
|
232
218
|
* Get the metadata hash from the schema.
|
|
@@ -242,30 +228,46 @@ class Schema {
|
|
|
242
228
|
return v1;
|
|
243
229
|
}
|
|
244
230
|
/**
|
|
245
|
-
* Get the
|
|
231
|
+
* Get the index of the provided known type within the schema.
|
|
232
|
+
* @param {KnownTypeId} known_type_id
|
|
233
|
+
* @returns {number}
|
|
234
|
+
*/
|
|
235
|
+
knownTypeIndex(known_type_id) {
|
|
236
|
+
const ret = wasm.schema_knownTypeIndex(this.__wbg_ptr, known_type_id);
|
|
237
|
+
if (ret[2]) {
|
|
238
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
239
|
+
}
|
|
240
|
+
return ret[0] >>> 0;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* @param {number} type_index
|
|
244
|
+
* @param {Uint8Array} input
|
|
246
245
|
* @returns {Uint8Array}
|
|
247
246
|
*/
|
|
248
|
-
|
|
249
|
-
const
|
|
247
|
+
eip712SigningHash(type_index, input) {
|
|
248
|
+
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
249
|
+
const len0 = WASM_VECTOR_LEN;
|
|
250
|
+
const ret = wasm.schema_eip712SigningHash(this.__wbg_ptr, type_index, ptr0, len0);
|
|
250
251
|
if (ret[3]) {
|
|
251
252
|
throw takeFromExternrefTable0(ret[2]);
|
|
252
253
|
}
|
|
253
|
-
var
|
|
254
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
254
255
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
255
|
-
return
|
|
256
|
+
return v2;
|
|
256
257
|
}
|
|
257
258
|
/**
|
|
259
|
+
* Displays the provided borsh bytes as a string according to the provided schema.
|
|
258
260
|
* @param {number} type_index
|
|
259
261
|
* @param {Uint8Array} input
|
|
260
262
|
* @returns {string}
|
|
261
263
|
*/
|
|
262
|
-
|
|
264
|
+
display(type_index, input) {
|
|
263
265
|
let deferred3_0;
|
|
264
266
|
let deferred3_1;
|
|
265
267
|
try {
|
|
266
268
|
const ptr0 = passArray8ToWasm0(input, wasm.__wbindgen_malloc);
|
|
267
269
|
const len0 = WASM_VECTOR_LEN;
|
|
268
|
-
const ret = wasm.
|
|
270
|
+
const ret = wasm.schema_display(this.__wbg_ptr, type_index, ptr0, len0);
|
|
269
271
|
var ptr2 = ret[0];
|
|
270
272
|
var len2 = ret[1];
|
|
271
273
|
if (ret[3]) {
|
|
@@ -280,20 +282,18 @@ class Schema {
|
|
|
280
282
|
}
|
|
281
283
|
}
|
|
282
284
|
/**
|
|
283
|
-
*
|
|
284
|
-
* @param {
|
|
285
|
-
* @returns {
|
|
285
|
+
* Creates a `Schema` instance from the provided JSON descriptor.
|
|
286
|
+
* @param {string} json
|
|
287
|
+
* @returns {Schema}
|
|
286
288
|
*/
|
|
287
|
-
|
|
288
|
-
const ptr0 =
|
|
289
|
+
static fromJSON(json) {
|
|
290
|
+
const ptr0 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
289
291
|
const len0 = WASM_VECTOR_LEN;
|
|
290
|
-
const ret = wasm.
|
|
291
|
-
if (ret[
|
|
292
|
-
throw takeFromExternrefTable0(ret[
|
|
292
|
+
const ret = wasm.schema_fromJSON(ptr0, len0);
|
|
293
|
+
if (ret[2]) {
|
|
294
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
293
295
|
}
|
|
294
|
-
|
|
295
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
296
|
-
return v2;
|
|
296
|
+
return Schema.__wrap(ret[0]);
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
module.exports.Schema = Schema;
|
|
Binary file
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_schema_free: (a: number, b: number) => void;
|
|
5
|
-
export const
|
|
5
|
+
export const schema_chainHash: (a: number) => [number, number, number, number];
|
|
6
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
7
|
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
8
|
export const schema_eip712Json: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
13
9
|
export const schema_eip712SigningHash: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
10
|
+
export const schema_fromJSON: (a: number, b: number) => [number, number, number];
|
|
11
|
+
export const schema_jsonToBorsh: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
12
|
+
export const schema_knownTypeIndex: (a: number, b: number) => [number, number, number];
|
|
13
|
+
export const schema_metadataHash: (a: number) => [number, number, number, number];
|
|
14
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
15
|
export const __externref_table_dealloc: (a: number) => void;
|
|
18
16
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
17
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
18
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
19
19
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sovereign-sdk/universal-wallet-wasm",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"repository":
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/Sovereign-Labs/sovereign-sdk.git"
|
|
7
|
+
},
|
|
5
8
|
"files": [
|
|
6
9
|
"dist/**/*",
|
|
7
10
|
"!dist/**/.gitignore",
|
|
@@ -25,7 +28,7 @@
|
|
|
25
28
|
"types": "dist/node/wallet_wasm.d.ts",
|
|
26
29
|
"devDependencies": {
|
|
27
30
|
"@types/node": "^22.7.4",
|
|
28
|
-
"vitest": "
|
|
31
|
+
"vitest": "4.0.7",
|
|
29
32
|
"wasm-pack": "^0.13.0"
|
|
30
33
|
},
|
|
31
34
|
"peerDependencies": {
|
|
@@ -38,6 +41,6 @@
|
|
|
38
41
|
"build": "pnpm run compile:node && pnpm run compile:esm && ./scripts/ensure_module_types.sh",
|
|
39
42
|
"compile:esm": "wasm-pack build --target bundler --release --out-dir dist/esm",
|
|
40
43
|
"compile:node": "wasm-pack build --target nodejs --release --out-dir dist/node",
|
|
41
|
-
"test": "
|
|
44
|
+
"test": "vitest run --project unit"
|
|
42
45
|
}
|
|
43
46
|
}
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|