@docknetwork/wallet-sdk-web 0.0.10 → 1.7.6
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/dist/wallet-sdk-web.esm.js +534 -473
- package/dist/wallet-sdk-web.iife.js +534 -473
- package/dist/wallet-sdk-web.iife.min.js +8 -7
- package/package.json +5 -5
- package/src/index.js +25 -19
- package/src/index.test.js +204 -0
|
@@ -4804,13 +4804,13 @@ var TruveraWebWallet = (function () {
|
|
|
4804
4804
|
name: 'Cheqd Mainnet',
|
|
4805
4805
|
substrateUrl: null,
|
|
4806
4806
|
addressPrefix: 22,
|
|
4807
|
-
cheqdApiUrl: 'https://mainnet.cheqd.docknode.io'
|
|
4807
|
+
cheqdApiUrl: ['https://mainnet.cheqd.docknode.io', 'https://rpc.cheqd.net']
|
|
4808
4808
|
},
|
|
4809
4809
|
testnet: {
|
|
4810
4810
|
name: 'Cheqd Testnet',
|
|
4811
4811
|
substrateUrl: null,
|
|
4812
4812
|
addressPrefix: 21,
|
|
4813
|
-
cheqdApiUrl: 'https://testnet.cheqd.docknode.io'
|
|
4813
|
+
cheqdApiUrl: ['https://testnet.cheqd.docknode.io', 'https://api.cheqd.network']
|
|
4814
4814
|
}};
|
|
4815
4815
|
|
|
4816
4816
|
const genericDocumentNetworkResolver = async _ref => {
|
|
@@ -83800,20 +83800,20 @@ var TruveraWebWallet = (function () {
|
|
|
83800
83800
|
CryptoKey: CryptoKey$1
|
|
83801
83801
|
});
|
|
83802
83802
|
|
|
83803
|
-
var crypto_1
|
|
83804
|
-
var hasRequiredCrypto$
|
|
83803
|
+
var crypto_1;
|
|
83804
|
+
var hasRequiredCrypto$1;
|
|
83805
83805
|
|
|
83806
|
-
function requireCrypto$
|
|
83807
|
-
if (hasRequiredCrypto$
|
|
83808
|
-
hasRequiredCrypto$
|
|
83806
|
+
function requireCrypto$1 () {
|
|
83807
|
+
if (hasRequiredCrypto$1) return crypto_1;
|
|
83808
|
+
hasRequiredCrypto$1 = 1;
|
|
83809
83809
|
|
|
83810
83810
|
var webcrypto = webcrypto_es;
|
|
83811
83811
|
var crypto = new webcrypto.Crypto();
|
|
83812
|
-
crypto_1
|
|
83813
|
-
return crypto_1
|
|
83812
|
+
crypto_1 = crypto;
|
|
83813
|
+
return crypto_1;
|
|
83814
83814
|
}
|
|
83815
83815
|
|
|
83816
|
-
var cryptoExports = requireCrypto$
|
|
83816
|
+
var cryptoExports = requireCrypto$1();
|
|
83817
83817
|
var crypto$7 = /*@__PURE__*/getDefaultExportFromCjs(cryptoExports);
|
|
83818
83818
|
|
|
83819
83819
|
let HMAC$1 = class HMAC {
|
|
@@ -97039,7 +97039,7 @@ var TruveraWebWallet = (function () {
|
|
|
97039
97039
|
return ret;
|
|
97040
97040
|
}
|
|
97041
97041
|
|
|
97042
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } }
|
|
97042
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } });
|
|
97043
97043
|
|
|
97044
97044
|
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }
|
|
97045
97045
|
let cachedUint8Memory0 = null;
|
|
@@ -97067,20 +97067,20 @@ var TruveraWebWallet = (function () {
|
|
|
97067
97067
|
|
|
97068
97068
|
let WASM_VECTOR_LEN = 0;
|
|
97069
97069
|
|
|
97070
|
-
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } }
|
|
97070
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } });
|
|
97071
97071
|
|
|
97072
97072
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
97073
97073
|
? function (arg, view) {
|
|
97074
|
-
|
|
97075
|
-
|
|
97074
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
97075
|
+
}
|
|
97076
97076
|
: function (arg, view) {
|
|
97077
|
-
|
|
97078
|
-
|
|
97079
|
-
|
|
97080
|
-
|
|
97081
|
-
|
|
97082
|
-
|
|
97083
|
-
|
|
97077
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
97078
|
+
view.set(buf);
|
|
97079
|
+
return {
|
|
97080
|
+
read: arg.length,
|
|
97081
|
+
written: buf.length
|
|
97082
|
+
};
|
|
97083
|
+
});
|
|
97084
97084
|
|
|
97085
97085
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
97086
97086
|
|
|
@@ -97155,7 +97155,7 @@ var TruveraWebWallet = (function () {
|
|
|
97155
97155
|
// primitive types
|
|
97156
97156
|
const type = typeof val;
|
|
97157
97157
|
if (type == 'number' || type == 'boolean' || val == null) {
|
|
97158
|
-
return
|
|
97158
|
+
return `${val}`;
|
|
97159
97159
|
}
|
|
97160
97160
|
if (type == 'string') {
|
|
97161
97161
|
return `"${val}"`;
|
|
@@ -97183,7 +97183,7 @@ var TruveraWebWallet = (function () {
|
|
|
97183
97183
|
if (length > 0) {
|
|
97184
97184
|
debug += debugString(val[0]);
|
|
97185
97185
|
}
|
|
97186
|
-
for(let i = 1; i < length; i++) {
|
|
97186
|
+
for (let i = 1; i < length; i++) {
|
|
97187
97187
|
debug += ', ' + debugString(val[i]);
|
|
97188
97188
|
}
|
|
97189
97189
|
debug += ']';
|
|
@@ -106299,122 +106299,128 @@ var TruveraWebWallet = (function () {
|
|
|
106299
106299
|
function __wbg_get_imports() {
|
|
106300
106300
|
const imports = {};
|
|
106301
106301
|
imports.wbg = {};
|
|
106302
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
106302
|
+
imports.wbg.__wbindgen_object_drop_ref = function (arg0) {
|
|
106303
106303
|
takeObject(arg0);
|
|
106304
106304
|
};
|
|
106305
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
106305
|
+
imports.wbg.__wbindgen_string_new = function (arg0, arg1) {
|
|
106306
106306
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
106307
106307
|
return addHeapObject(ret);
|
|
106308
106308
|
};
|
|
106309
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
106310
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
106309
|
+
imports.wbg.__wbindgen_is_string = function (arg0) {
|
|
106310
|
+
const ret = typeof (getObject(arg0)) === 'string';
|
|
106311
106311
|
return ret;
|
|
106312
106312
|
};
|
|
106313
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
106313
|
+
imports.wbg.__wbindgen_is_undefined = function (arg0) {
|
|
106314
106314
|
const ret = getObject(arg0) === undefined;
|
|
106315
106315
|
return ret;
|
|
106316
106316
|
};
|
|
106317
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
106317
|
+
imports.wbg.__wbindgen_object_clone_ref = function (arg0) {
|
|
106318
106318
|
const ret = getObject(arg0);
|
|
106319
106319
|
return addHeapObject(ret);
|
|
106320
106320
|
};
|
|
106321
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
106321
|
+
imports.wbg.__wbindgen_string_get = function (arg0, arg1) {
|
|
106322
106322
|
const obj = getObject(arg1);
|
|
106323
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
106323
|
+
const ret = typeof (obj) === 'string' ? obj : undefined;
|
|
106324
106324
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
106325
106325
|
var len1 = WASM_VECTOR_LEN;
|
|
106326
106326
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
106327
106327
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
106328
106328
|
};
|
|
106329
|
-
imports.wbg.__wbindgen_as_number = function(arg0) {
|
|
106329
|
+
imports.wbg.__wbindgen_as_number = function (arg0) {
|
|
106330
106330
|
const ret = +getObject(arg0);
|
|
106331
106331
|
return ret;
|
|
106332
106332
|
};
|
|
106333
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
106333
|
+
imports.wbg.__wbindgen_number_new = function (arg0) {
|
|
106334
106334
|
const ret = arg0;
|
|
106335
106335
|
return addHeapObject(ret);
|
|
106336
106336
|
};
|
|
106337
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
106337
|
+
imports.wbg.__wbindgen_is_object = function (arg0) {
|
|
106338
106338
|
const val = getObject(arg0);
|
|
106339
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
106339
|
+
const ret = typeof (val) === 'object' && val !== null;
|
|
106340
106340
|
return ret;
|
|
106341
106341
|
};
|
|
106342
|
-
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
106342
|
+
imports.wbg.__wbindgen_in = function (arg0, arg1) {
|
|
106343
106343
|
const ret = getObject(arg0) in getObject(arg1);
|
|
106344
106344
|
return ret;
|
|
106345
106345
|
};
|
|
106346
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
106346
|
+
imports.wbg.__wbindgen_error_new = function (arg0, arg1) {
|
|
106347
106347
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
106348
106348
|
return addHeapObject(ret);
|
|
106349
106349
|
};
|
|
106350
|
-
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
106351
|
-
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
106350
|
+
imports.wbg.__wbindgen_is_bigint = function (arg0) {
|
|
106351
|
+
const ret = typeof (getObject(arg0)) === 'bigint';
|
|
106352
106352
|
return ret;
|
|
106353
106353
|
};
|
|
106354
|
-
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
106354
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function (arg0) {
|
|
106355
106355
|
const ret = BigInt.asUintN(64, arg0);
|
|
106356
106356
|
return addHeapObject(ret);
|
|
106357
106357
|
};
|
|
106358
|
-
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
106358
|
+
imports.wbg.__wbindgen_jsval_eq = function (arg0, arg1) {
|
|
106359
106359
|
const ret = getObject(arg0) === getObject(arg1);
|
|
106360
106360
|
return ret;
|
|
106361
106361
|
};
|
|
106362
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
106362
|
+
imports.wbg.__wbindgen_number_get = function (arg0, arg1) {
|
|
106363
106363
|
const obj = getObject(arg1);
|
|
106364
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
106364
|
+
const ret = typeof (obj) === 'number' ? obj : undefined;
|
|
106365
106365
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
106366
106366
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
106367
106367
|
};
|
|
106368
|
-
imports.wbg.__wbindgen_ge = function(arg0, arg1) {
|
|
106368
|
+
imports.wbg.__wbindgen_ge = function (arg0, arg1) {
|
|
106369
106369
|
const ret = getObject(arg0) >= getObject(arg1);
|
|
106370
106370
|
return ret;
|
|
106371
106371
|
};
|
|
106372
|
-
imports.wbg.__wbg_crypto_d05b68a3572bb8ca = function(arg0) {
|
|
106372
|
+
imports.wbg.__wbg_crypto_d05b68a3572bb8ca = function (arg0) {
|
|
106373
106373
|
const ret = getObject(arg0).crypto;
|
|
106374
106374
|
return addHeapObject(ret);
|
|
106375
106375
|
};
|
|
106376
|
-
imports.wbg.__wbg_process_b02b3570280d0366 = function(arg0) {
|
|
106376
|
+
imports.wbg.__wbg_process_b02b3570280d0366 = function (arg0) {
|
|
106377
106377
|
const ret = getObject(arg0).process;
|
|
106378
106378
|
return addHeapObject(ret);
|
|
106379
106379
|
};
|
|
106380
|
-
imports.wbg.__wbg_versions_c1cb42213cedf0f5 = function(arg0) {
|
|
106380
|
+
imports.wbg.__wbg_versions_c1cb42213cedf0f5 = function (arg0) {
|
|
106381
106381
|
const ret = getObject(arg0).versions;
|
|
106382
106382
|
return addHeapObject(ret);
|
|
106383
106383
|
};
|
|
106384
|
-
imports.wbg.__wbg_node_43b1089f407e4ec2 = function(arg0) {
|
|
106384
|
+
imports.wbg.__wbg_node_43b1089f407e4ec2 = function (arg0) {
|
|
106385
106385
|
const ret = getObject(arg0).node;
|
|
106386
106386
|
return addHeapObject(ret);
|
|
106387
106387
|
};
|
|
106388
|
-
imports.wbg.__wbg_require_9a7e0f667ead4995 = function
|
|
106389
|
-
|
|
106390
|
-
|
|
106391
|
-
|
|
106392
|
-
|
|
106393
|
-
|
|
106388
|
+
imports.wbg.__wbg_require_9a7e0f667ead4995 = function () {
|
|
106389
|
+
return handleError(function () {
|
|
106390
|
+
const ret = commonjsRequire;
|
|
106391
|
+
return addHeapObject(ret);
|
|
106392
|
+
}, arguments)
|
|
106393
|
+
};
|
|
106394
|
+
imports.wbg.__wbindgen_is_function = function (arg0) {
|
|
106395
|
+
const ret = typeof (getObject(arg0)) === 'function';
|
|
106394
106396
|
return ret;
|
|
106395
106397
|
};
|
|
106396
|
-
imports.wbg.__wbg_msCrypto_10fc94afee92bd76 = function(arg0) {
|
|
106398
|
+
imports.wbg.__wbg_msCrypto_10fc94afee92bd76 = function (arg0) {
|
|
106397
106399
|
const ret = getObject(arg0).msCrypto;
|
|
106398
106400
|
return addHeapObject(ret);
|
|
106399
106401
|
};
|
|
106400
|
-
imports.wbg.__wbg_randomFillSync_b70ccbdf4926a99d = function
|
|
106401
|
-
|
|
106402
|
-
|
|
106403
|
-
|
|
106404
|
-
|
|
106405
|
-
|
|
106406
|
-
|
|
106402
|
+
imports.wbg.__wbg_randomFillSync_b70ccbdf4926a99d = function () {
|
|
106403
|
+
return handleError(function (arg0, arg1) {
|
|
106404
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
106405
|
+
}, arguments)
|
|
106406
|
+
};
|
|
106407
|
+
imports.wbg.__wbg_getRandomValues_7e42b4fb8779dc6d = function () {
|
|
106408
|
+
return handleError(function (arg0, arg1) {
|
|
106409
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
106410
|
+
}, arguments)
|
|
106411
|
+
};
|
|
106412
|
+
imports.wbg.__wbg_new_abda76e883ba8a5f = function () {
|
|
106407
106413
|
const ret = new Error();
|
|
106408
106414
|
return addHeapObject(ret);
|
|
106409
106415
|
};
|
|
106410
|
-
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
106416
|
+
imports.wbg.__wbg_stack_658279fe44541cf6 = function (arg0, arg1) {
|
|
106411
106417
|
const ret = getObject(arg1).stack;
|
|
106412
106418
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
106413
106419
|
const len1 = WASM_VECTOR_LEN;
|
|
106414
106420
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
106415
106421
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
106416
106422
|
};
|
|
106417
|
-
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
106423
|
+
imports.wbg.__wbg_error_f851667af71bcfc6 = function (arg0, arg1) {
|
|
106418
106424
|
let deferred0_0;
|
|
106419
106425
|
let deferred0_1;
|
|
106420
106426
|
try {
|
|
@@ -106425,19 +106431,19 @@ var TruveraWebWallet = (function () {
|
|
|
106425
106431
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
106426
106432
|
}
|
|
106427
106433
|
};
|
|
106428
|
-
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
106434
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function (arg0) {
|
|
106429
106435
|
const ret = arg0;
|
|
106430
106436
|
return addHeapObject(ret);
|
|
106431
106437
|
};
|
|
106432
|
-
imports.wbg.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
|
|
106438
|
+
imports.wbg.__wbindgen_bigint_from_u128 = function (arg0, arg1) {
|
|
106433
106439
|
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
|
|
106434
106440
|
return addHeapObject(ret);
|
|
106435
106441
|
};
|
|
106436
|
-
imports.wbg.__wbindgen_shr = function(arg0, arg1) {
|
|
106442
|
+
imports.wbg.__wbindgen_shr = function (arg0, arg1) {
|
|
106437
106443
|
const ret = getObject(arg0) >> getObject(arg1);
|
|
106438
106444
|
return addHeapObject(ret);
|
|
106439
106445
|
};
|
|
106440
|
-
imports.wbg.__wbg_instanceof_Global_68951a6a6244ac6e = function(arg0) {
|
|
106446
|
+
imports.wbg.__wbg_instanceof_Global_68951a6a6244ac6e = function (arg0) {
|
|
106441
106447
|
let result;
|
|
106442
106448
|
try {
|
|
106443
106449
|
result = getObject(arg0) instanceof WebAssembly.Global;
|
|
@@ -106447,122 +106453,136 @@ var TruveraWebWallet = (function () {
|
|
|
106447
106453
|
const ret = result;
|
|
106448
106454
|
return ret;
|
|
106449
106455
|
};
|
|
106450
|
-
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
106456
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function (arg0, arg1) {
|
|
106451
106457
|
const ret = getObject(arg0) == getObject(arg1);
|
|
106452
106458
|
return ret;
|
|
106453
106459
|
};
|
|
106454
|
-
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
106460
|
+
imports.wbg.__wbindgen_boolean_get = function (arg0) {
|
|
106455
106461
|
const v = getObject(arg0);
|
|
106456
|
-
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
106462
|
+
const ret = typeof (v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
106457
106463
|
return ret;
|
|
106458
106464
|
};
|
|
106459
|
-
imports.wbg.__wbg_static_accessor_SYMBOL_45d4d15e3c4aeb33 = function() {
|
|
106465
|
+
imports.wbg.__wbg_static_accessor_SYMBOL_45d4d15e3c4aeb33 = function () {
|
|
106460
106466
|
const ret = Symbol;
|
|
106461
106467
|
return addHeapObject(ret);
|
|
106462
106468
|
};
|
|
106463
|
-
imports.wbg.__wbindgen_is_symbol = function(arg0) {
|
|
106464
|
-
const ret = typeof(getObject(arg0)) === 'symbol';
|
|
106469
|
+
imports.wbg.__wbindgen_is_symbol = function (arg0) {
|
|
106470
|
+
const ret = typeof (getObject(arg0)) === 'symbol';
|
|
106465
106471
|
return ret;
|
|
106466
106472
|
};
|
|
106467
|
-
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
|
|
106473
|
+
imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function (arg0, arg1) {
|
|
106468
106474
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
106469
106475
|
return addHeapObject(ret);
|
|
106470
106476
|
};
|
|
106471
|
-
imports.wbg.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
|
|
106477
|
+
imports.wbg.__wbg_set_f975102236d3c502 = function (arg0, arg1, arg2) {
|
|
106472
106478
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
106473
106479
|
};
|
|
106474
|
-
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
106480
|
+
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function (arg0, arg1) {
|
|
106475
106481
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
106476
106482
|
return addHeapObject(ret);
|
|
106477
106483
|
};
|
|
106478
|
-
imports.wbg.__wbg_length_820c786973abdd8a = function(arg0) {
|
|
106484
|
+
imports.wbg.__wbg_length_820c786973abdd8a = function (arg0) {
|
|
106479
106485
|
const ret = getObject(arg0).length;
|
|
106480
106486
|
return ret;
|
|
106481
106487
|
};
|
|
106482
|
-
imports.wbg.__wbg_new_0394642eae39db16 = function() {
|
|
106488
|
+
imports.wbg.__wbg_new_0394642eae39db16 = function () {
|
|
106483
106489
|
const ret = new Array();
|
|
106484
106490
|
return addHeapObject(ret);
|
|
106485
106491
|
};
|
|
106486
|
-
imports.wbg.__wbg_BigInt_9523742cb675bb6f = function(arg0) {
|
|
106492
|
+
imports.wbg.__wbg_BigInt_9523742cb675bb6f = function (arg0) {
|
|
106487
106493
|
const ret = BigInt(getObject(arg0));
|
|
106488
106494
|
return addHeapObject(ret);
|
|
106489
106495
|
};
|
|
106490
|
-
imports.wbg.__wbg_newnoargs_c9e6043b8ad84109 = function(arg0, arg1) {
|
|
106496
|
+
imports.wbg.__wbg_newnoargs_c9e6043b8ad84109 = function (arg0, arg1) {
|
|
106491
106497
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
106492
106498
|
return addHeapObject(ret);
|
|
106493
106499
|
};
|
|
106494
|
-
imports.wbg.__wbg_new_0f2b71ca2f2a6029 = function() {
|
|
106500
|
+
imports.wbg.__wbg_new_0f2b71ca2f2a6029 = function () {
|
|
106495
106501
|
const ret = new Map();
|
|
106496
106502
|
return addHeapObject(ret);
|
|
106497
106503
|
};
|
|
106498
|
-
imports.wbg.__wbg_next_f4bc0e96ea67da68 = function(arg0) {
|
|
106504
|
+
imports.wbg.__wbg_next_f4bc0e96ea67da68 = function (arg0) {
|
|
106499
106505
|
const ret = getObject(arg0).next;
|
|
106500
106506
|
return addHeapObject(ret);
|
|
106501
106507
|
};
|
|
106502
|
-
imports.wbg.__wbg_next_ec061e48a0e72a96 = function
|
|
106503
|
-
|
|
106504
|
-
|
|
106505
|
-
|
|
106506
|
-
|
|
106508
|
+
imports.wbg.__wbg_next_ec061e48a0e72a96 = function () {
|
|
106509
|
+
return handleError(function (arg0) {
|
|
106510
|
+
const ret = getObject(arg0).next();
|
|
106511
|
+
return addHeapObject(ret);
|
|
106512
|
+
}, arguments)
|
|
106513
|
+
};
|
|
106514
|
+
imports.wbg.__wbg_done_b6abb27d42b63867 = function (arg0) {
|
|
106507
106515
|
const ret = getObject(arg0).done;
|
|
106508
106516
|
return ret;
|
|
106509
106517
|
};
|
|
106510
|
-
imports.wbg.__wbg_value_2f4ef2036bfad28e = function(arg0) {
|
|
106518
|
+
imports.wbg.__wbg_value_2f4ef2036bfad28e = function (arg0) {
|
|
106511
106519
|
const ret = getObject(arg0).value;
|
|
106512
106520
|
return addHeapObject(ret);
|
|
106513
106521
|
};
|
|
106514
|
-
imports.wbg.__wbg_iterator_7c7e58f62eb84700 = function() {
|
|
106522
|
+
imports.wbg.__wbg_iterator_7c7e58f62eb84700 = function () {
|
|
106515
106523
|
const ret = Symbol.iterator;
|
|
106516
106524
|
return addHeapObject(ret);
|
|
106517
106525
|
};
|
|
106518
|
-
imports.wbg.__wbg_get_f53c921291c381bd = function
|
|
106519
|
-
|
|
106520
|
-
|
|
106521
|
-
|
|
106522
|
-
|
|
106523
|
-
|
|
106524
|
-
|
|
106525
|
-
|
|
106526
|
-
|
|
106526
|
+
imports.wbg.__wbg_get_f53c921291c381bd = function () {
|
|
106527
|
+
return handleError(function (arg0, arg1) {
|
|
106528
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
106529
|
+
return addHeapObject(ret);
|
|
106530
|
+
}, arguments)
|
|
106531
|
+
};
|
|
106532
|
+
imports.wbg.__wbg_call_557a2f2deacc4912 = function () {
|
|
106533
|
+
return handleError(function (arg0, arg1) {
|
|
106534
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
106535
|
+
return addHeapObject(ret);
|
|
106536
|
+
}, arguments)
|
|
106537
|
+
};
|
|
106538
|
+
imports.wbg.__wbg_new_2b6fea4ea03b1b95 = function () {
|
|
106527
106539
|
const ret = new Object();
|
|
106528
106540
|
return addHeapObject(ret);
|
|
106529
106541
|
};
|
|
106530
|
-
imports.wbg.__wbg_self_742dd6eab3e9211e = function
|
|
106531
|
-
|
|
106532
|
-
|
|
106533
|
-
|
|
106534
|
-
|
|
106535
|
-
|
|
106536
|
-
|
|
106537
|
-
|
|
106538
|
-
|
|
106539
|
-
|
|
106540
|
-
|
|
106541
|
-
}
|
|
106542
|
-
imports.wbg.
|
|
106543
|
-
|
|
106544
|
-
|
|
106545
|
-
|
|
106546
|
-
|
|
106542
|
+
imports.wbg.__wbg_self_742dd6eab3e9211e = function () {
|
|
106543
|
+
return handleError(function () {
|
|
106544
|
+
const ret = self.self;
|
|
106545
|
+
return addHeapObject(ret);
|
|
106546
|
+
}, arguments)
|
|
106547
|
+
};
|
|
106548
|
+
imports.wbg.__wbg_window_c409e731db53a0e2 = function () {
|
|
106549
|
+
return handleError(function () {
|
|
106550
|
+
const ret = window.window;
|
|
106551
|
+
return addHeapObject(ret);
|
|
106552
|
+
}, arguments)
|
|
106553
|
+
};
|
|
106554
|
+
imports.wbg.__wbg_globalThis_b70c095388441f2d = function () {
|
|
106555
|
+
return handleError(function () {
|
|
106556
|
+
const ret = globalThis.globalThis;
|
|
106557
|
+
return addHeapObject(ret);
|
|
106558
|
+
}, arguments)
|
|
106559
|
+
};
|
|
106560
|
+
imports.wbg.__wbg_global_1c72617491ed7194 = function () {
|
|
106561
|
+
return handleError(function () {
|
|
106562
|
+
const ret = commonjsGlobal.global;
|
|
106563
|
+
return addHeapObject(ret);
|
|
106564
|
+
}, arguments)
|
|
106565
|
+
};
|
|
106566
|
+
imports.wbg.__wbg_newwithlength_cd1db47a173e3944 = function (arg0) {
|
|
106547
106567
|
const ret = new Array(arg0 >>> 0);
|
|
106548
106568
|
return addHeapObject(ret);
|
|
106549
106569
|
};
|
|
106550
|
-
imports.wbg.__wbg_set_b4da98d504ac6091 = function(arg0, arg1, arg2) {
|
|
106570
|
+
imports.wbg.__wbg_set_b4da98d504ac6091 = function (arg0, arg1, arg2) {
|
|
106551
106571
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
106552
106572
|
};
|
|
106553
|
-
imports.wbg.__wbg_from_6bc98a09a0b58bb1 = function(arg0) {
|
|
106573
|
+
imports.wbg.__wbg_from_6bc98a09a0b58bb1 = function (arg0) {
|
|
106554
106574
|
const ret = Array.from(getObject(arg0));
|
|
106555
106575
|
return addHeapObject(ret);
|
|
106556
106576
|
};
|
|
106557
|
-
imports.wbg.__wbg_isArray_04e59fb73f78ab5b = function(arg0) {
|
|
106577
|
+
imports.wbg.__wbg_isArray_04e59fb73f78ab5b = function (arg0) {
|
|
106558
106578
|
const ret = Array.isArray(getObject(arg0));
|
|
106559
106579
|
return ret;
|
|
106560
106580
|
};
|
|
106561
|
-
imports.wbg.__wbg_push_109cfc26d02582dd = function(arg0, arg1) {
|
|
106581
|
+
imports.wbg.__wbg_push_109cfc26d02582dd = function (arg0, arg1) {
|
|
106562
106582
|
const ret = getObject(arg0).push(getObject(arg1));
|
|
106563
106583
|
return ret;
|
|
106564
106584
|
};
|
|
106565
|
-
imports.wbg.__wbg_instanceof_ArrayBuffer_ef2632aa0d4bfff8 = function(arg0) {
|
|
106585
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_ef2632aa0d4bfff8 = function (arg0) {
|
|
106566
106586
|
let result;
|
|
106567
106587
|
try {
|
|
106568
106588
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -106572,22 +106592,22 @@ var TruveraWebWallet = (function () {
|
|
|
106572
106592
|
const ret = result;
|
|
106573
106593
|
return ret;
|
|
106574
106594
|
};
|
|
106575
|
-
imports.wbg.__wbg_entries_251d437c1b5de416 = function(arg0) {
|
|
106595
|
+
imports.wbg.__wbg_entries_251d437c1b5de416 = function (arg0) {
|
|
106576
106596
|
const ret = getObject(arg0).entries();
|
|
106577
106597
|
return addHeapObject(ret);
|
|
106578
106598
|
};
|
|
106579
|
-
imports.wbg.__wbg_values_37eb2197bdbdfdd8 = function(arg0) {
|
|
106599
|
+
imports.wbg.__wbg_values_37eb2197bdbdfdd8 = function (arg0) {
|
|
106580
106600
|
const ret = getObject(arg0).values();
|
|
106581
106601
|
return addHeapObject(ret);
|
|
106582
106602
|
};
|
|
106583
|
-
imports.wbg.__wbg_toString_68dcf9fa017bbb08 = function(arg0, arg1, arg2) {
|
|
106603
|
+
imports.wbg.__wbg_toString_68dcf9fa017bbb08 = function (arg0, arg1, arg2) {
|
|
106584
106604
|
const ret = getObject(arg1).toString(arg2);
|
|
106585
106605
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
106586
106606
|
const len1 = WASM_VECTOR_LEN;
|
|
106587
106607
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
106588
106608
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
106589
106609
|
};
|
|
106590
|
-
imports.wbg.__wbg_instanceof_Function_8e1bcaacb89c4438 = function(arg0) {
|
|
106610
|
+
imports.wbg.__wbg_instanceof_Function_8e1bcaacb89c4438 = function (arg0) {
|
|
106591
106611
|
let result;
|
|
106592
106612
|
try {
|
|
106593
106613
|
result = getObject(arg0) instanceof Function;
|
|
@@ -106597,66 +106617,68 @@ var TruveraWebWallet = (function () {
|
|
|
106597
106617
|
const ret = result;
|
|
106598
106618
|
return ret;
|
|
106599
106619
|
};
|
|
106600
|
-
imports.wbg.__wbg_call_587b30eea3e09332 = function
|
|
106601
|
-
|
|
106602
|
-
|
|
106603
|
-
|
|
106604
|
-
|
|
106620
|
+
imports.wbg.__wbg_call_587b30eea3e09332 = function () {
|
|
106621
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
106622
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
106623
|
+
return addHeapObject(ret);
|
|
106624
|
+
}, arguments)
|
|
106625
|
+
};
|
|
106626
|
+
imports.wbg.__wbg_bind_7d5ce7224bedd5b8 = function (arg0, arg1, arg2) {
|
|
106605
106627
|
const ret = getObject(arg0).bind(getObject(arg1), getObject(arg2));
|
|
106606
106628
|
return addHeapObject(ret);
|
|
106607
106629
|
};
|
|
106608
|
-
imports.wbg.__wbg_get_ee04a929b42f2cae = function(arg0, arg1) {
|
|
106630
|
+
imports.wbg.__wbg_get_ee04a929b42f2cae = function (arg0, arg1) {
|
|
106609
106631
|
const ret = getObject(arg0).get(getObject(arg1));
|
|
106610
106632
|
return addHeapObject(ret);
|
|
106611
106633
|
};
|
|
106612
|
-
imports.wbg.__wbg_set_da7be7bf0e037b14 = function(arg0, arg1, arg2) {
|
|
106634
|
+
imports.wbg.__wbg_set_da7be7bf0e037b14 = function (arg0, arg1, arg2) {
|
|
106613
106635
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
106614
106636
|
return addHeapObject(ret);
|
|
106615
106637
|
};
|
|
106616
|
-
imports.wbg.__wbg_entries_039ff76b77e573c1 = function(arg0) {
|
|
106638
|
+
imports.wbg.__wbg_entries_039ff76b77e573c1 = function (arg0) {
|
|
106617
106639
|
const ret = getObject(arg0).entries();
|
|
106618
106640
|
return addHeapObject(ret);
|
|
106619
106641
|
};
|
|
106620
|
-
imports.wbg.__wbg_isSafeInteger_2088b01008075470 = function(arg0) {
|
|
106642
|
+
imports.wbg.__wbg_isSafeInteger_2088b01008075470 = function (arg0) {
|
|
106621
106643
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
106622
106644
|
return ret;
|
|
106623
106645
|
};
|
|
106624
|
-
imports.wbg.__wbg_valueOf_393207f7572c73ba = function(arg0) {
|
|
106646
|
+
imports.wbg.__wbg_valueOf_393207f7572c73ba = function (arg0) {
|
|
106625
106647
|
const ret = getObject(arg0).valueOf();
|
|
106626
106648
|
return ret;
|
|
106627
106649
|
};
|
|
106628
|
-
imports.wbg.__wbg_constructor_f2623999a1f453eb = function(arg0) {
|
|
106650
|
+
imports.wbg.__wbg_constructor_f2623999a1f453eb = function (arg0) {
|
|
106629
106651
|
const ret = getObject(arg0).constructor;
|
|
106630
106652
|
return addHeapObject(ret);
|
|
106631
106653
|
};
|
|
106632
|
-
imports.wbg.__wbg_entries_13e011453776468f = function(arg0) {
|
|
106654
|
+
imports.wbg.__wbg_entries_13e011453776468f = function (arg0) {
|
|
106633
106655
|
const ret = Object.entries(getObject(arg0));
|
|
106634
106656
|
return addHeapObject(ret);
|
|
106635
106657
|
};
|
|
106636
|
-
imports.wbg.__wbg_values_ab94410c1dc594fb = function(arg0) {
|
|
106658
|
+
imports.wbg.__wbg_values_ab94410c1dc594fb = function (arg0) {
|
|
106637
106659
|
const ret = getObject(arg0).values();
|
|
106638
106660
|
return addHeapObject(ret);
|
|
106639
106661
|
};
|
|
106640
|
-
imports.wbg.__wbg_buffer_55ba7a6b1b92e2ac = function(arg0) {
|
|
106662
|
+
imports.wbg.__wbg_buffer_55ba7a6b1b92e2ac = function (arg0) {
|
|
106641
106663
|
const ret = getObject(arg0).buffer;
|
|
106642
106664
|
return addHeapObject(ret);
|
|
106643
106665
|
};
|
|
106644
|
-
imports.wbg.__wbg_newwithbyteoffsetandlength_88d1d8be5df94b9b = function(arg0, arg1, arg2) {
|
|
106666
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_88d1d8be5df94b9b = function (arg0, arg1, arg2) {
|
|
106645
106667
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
106646
106668
|
return addHeapObject(ret);
|
|
106647
106669
|
};
|
|
106648
|
-
imports.wbg.__wbg_new_09938a7d020f049b = function(arg0) {
|
|
106670
|
+
imports.wbg.__wbg_new_09938a7d020f049b = function (arg0) {
|
|
106649
106671
|
const ret = new Uint8Array(getObject(arg0));
|
|
106650
106672
|
return addHeapObject(ret);
|
|
106651
106673
|
};
|
|
106652
|
-
imports.wbg.__wbg_set_3698e3ca519b3c3c = function(arg0, arg1, arg2) {
|
|
106674
|
+
imports.wbg.__wbg_set_3698e3ca519b3c3c = function (arg0, arg1, arg2) {
|
|
106653
106675
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
106654
106676
|
};
|
|
106655
|
-
imports.wbg.__wbg_length_0aab7ffd65ad19ed = function(arg0) {
|
|
106677
|
+
imports.wbg.__wbg_length_0aab7ffd65ad19ed = function (arg0) {
|
|
106656
106678
|
const ret = getObject(arg0).length;
|
|
106657
106679
|
return ret;
|
|
106658
106680
|
};
|
|
106659
|
-
imports.wbg.__wbg_instanceof_Uint8Array_1349640af2da2e88 = function(arg0) {
|
|
106681
|
+
imports.wbg.__wbg_instanceof_Uint8Array_1349640af2da2e88 = function (arg0) {
|
|
106660
106682
|
let result;
|
|
106661
106683
|
try {
|
|
106662
106684
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -106666,47 +106688,57 @@ var TruveraWebWallet = (function () {
|
|
|
106666
106688
|
const ret = result;
|
|
106667
106689
|
return ret;
|
|
106668
106690
|
};
|
|
106669
|
-
imports.wbg.__wbg_newwithlength_89eeca401d8918c2 = function(arg0) {
|
|
106691
|
+
imports.wbg.__wbg_newwithlength_89eeca401d8918c2 = function (arg0) {
|
|
106670
106692
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
106671
106693
|
return addHeapObject(ret);
|
|
106672
106694
|
};
|
|
106673
|
-
imports.wbg.__wbg_subarray_d82be056deb4ad27 = function(arg0, arg1, arg2) {
|
|
106695
|
+
imports.wbg.__wbg_subarray_d82be056deb4ad27 = function (arg0, arg1, arg2) {
|
|
106674
106696
|
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
106675
106697
|
return addHeapObject(ret);
|
|
106676
106698
|
};
|
|
106677
|
-
imports.wbg.__wbg_apply_46ea2bb0ad750196 = function
|
|
106678
|
-
|
|
106679
|
-
|
|
106680
|
-
|
|
106681
|
-
|
|
106682
|
-
|
|
106683
|
-
|
|
106684
|
-
|
|
106685
|
-
|
|
106686
|
-
|
|
106687
|
-
|
|
106688
|
-
}
|
|
106689
|
-
imports.wbg.
|
|
106690
|
-
|
|
106691
|
-
|
|
106692
|
-
|
|
106693
|
-
|
|
106699
|
+
imports.wbg.__wbg_apply_46ea2bb0ad750196 = function () {
|
|
106700
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
106701
|
+
const ret = Reflect.apply(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
106702
|
+
return addHeapObject(ret);
|
|
106703
|
+
}, arguments)
|
|
106704
|
+
};
|
|
106705
|
+
imports.wbg.__wbg_getPrototypeOf_7dc7a2328db2bc0e = function () {
|
|
106706
|
+
return handleError(function (arg0) {
|
|
106707
|
+
const ret = Reflect.getPrototypeOf(getObject(arg0));
|
|
106708
|
+
return addHeapObject(ret);
|
|
106709
|
+
}, arguments)
|
|
106710
|
+
};
|
|
106711
|
+
imports.wbg.__wbg_set_07da13cc24b69217 = function () {
|
|
106712
|
+
return handleError(function (arg0, arg1, arg2) {
|
|
106713
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
106714
|
+
return ret;
|
|
106715
|
+
}, arguments)
|
|
106716
|
+
};
|
|
106717
|
+
imports.wbg.__wbg_new_d5513c182d79afcb = function () {
|
|
106718
|
+
return handleError(function (arg0, arg1) {
|
|
106719
|
+
const ret = new WebAssembly.Instance(getObject(arg0), getObject(arg1));
|
|
106720
|
+
return addHeapObject(ret);
|
|
106721
|
+
}, arguments)
|
|
106722
|
+
};
|
|
106723
|
+
imports.wbg.__wbg_exports_311291a1333429a3 = function (arg0) {
|
|
106694
106724
|
const ret = getObject(arg0).exports;
|
|
106695
106725
|
return addHeapObject(ret);
|
|
106696
106726
|
};
|
|
106697
|
-
imports.wbg.__wbg_new_5e81aea3ac1b5637 = function
|
|
106698
|
-
|
|
106699
|
-
|
|
106700
|
-
|
|
106701
|
-
|
|
106727
|
+
imports.wbg.__wbg_new_5e81aea3ac1b5637 = function () {
|
|
106728
|
+
return handleError(function (arg0) {
|
|
106729
|
+
const ret = new WebAssembly.Module(getObject(arg0));
|
|
106730
|
+
return addHeapObject(ret);
|
|
106731
|
+
}, arguments)
|
|
106732
|
+
};
|
|
106733
|
+
imports.wbg.__wbg_exports_12505982ae149cb0 = function (arg0) {
|
|
106702
106734
|
const ret = WebAssembly.Module.exports(getObject(arg0));
|
|
106703
106735
|
return addHeapObject(ret);
|
|
106704
106736
|
};
|
|
106705
|
-
imports.wbg.__wbg_imports_e63d0b7b63c4e1ff = function(arg0) {
|
|
106737
|
+
imports.wbg.__wbg_imports_e63d0b7b63c4e1ff = function (arg0) {
|
|
106706
106738
|
const ret = WebAssembly.Module.imports(getObject(arg0));
|
|
106707
106739
|
return addHeapObject(ret);
|
|
106708
106740
|
};
|
|
106709
|
-
imports.wbg.__wbg_instanceof_Table_b0af5234a12a19f9 = function(arg0) {
|
|
106741
|
+
imports.wbg.__wbg_instanceof_Table_b0af5234a12a19f9 = function (arg0) {
|
|
106710
106742
|
let result;
|
|
106711
106743
|
try {
|
|
106712
106744
|
result = getObject(arg0) instanceof WebAssembly.Table;
|
|
@@ -106716,11 +106748,13 @@ var TruveraWebWallet = (function () {
|
|
|
106716
106748
|
const ret = result;
|
|
106717
106749
|
return ret;
|
|
106718
106750
|
};
|
|
106719
|
-
imports.wbg.__wbg_get_b5def15f90c3e295 = function
|
|
106720
|
-
|
|
106721
|
-
|
|
106722
|
-
|
|
106723
|
-
|
|
106751
|
+
imports.wbg.__wbg_get_b5def15f90c3e295 = function () {
|
|
106752
|
+
return handleError(function (arg0, arg1) {
|
|
106753
|
+
const ret = getObject(arg0).get(arg1 >>> 0);
|
|
106754
|
+
return addHeapObject(ret);
|
|
106755
|
+
}, arguments)
|
|
106756
|
+
};
|
|
106757
|
+
imports.wbg.__wbg_instanceof_Memory_331618ccd3fa615d = function (arg0) {
|
|
106724
106758
|
let result;
|
|
106725
106759
|
try {
|
|
106726
106760
|
result = getObject(arg0) instanceof WebAssembly.Memory;
|
|
@@ -106730,27 +106764,27 @@ var TruveraWebWallet = (function () {
|
|
|
106730
106764
|
const ret = result;
|
|
106731
106765
|
return ret;
|
|
106732
106766
|
};
|
|
106733
|
-
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
106767
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function (arg0, arg1) {
|
|
106734
106768
|
const v = getObject(arg1);
|
|
106735
|
-
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
106769
|
+
const ret = typeof (v) === 'bigint' ? v : undefined;
|
|
106736
106770
|
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
|
|
106737
106771
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
106738
106772
|
};
|
|
106739
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
106773
|
+
imports.wbg.__wbindgen_debug_string = function (arg0, arg1) {
|
|
106740
106774
|
const ret = debugString(getObject(arg1));
|
|
106741
106775
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
106742
106776
|
const len1 = WASM_VECTOR_LEN;
|
|
106743
106777
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
106744
106778
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
106745
106779
|
};
|
|
106746
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
106780
|
+
imports.wbg.__wbindgen_throw = function (arg0, arg1) {
|
|
106747
106781
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
106748
106782
|
};
|
|
106749
|
-
imports.wbg.__wbindgen_memory = function() {
|
|
106783
|
+
imports.wbg.__wbindgen_memory = function () {
|
|
106750
106784
|
const ret = wasm.memory;
|
|
106751
106785
|
return addHeapObject(ret);
|
|
106752
106786
|
};
|
|
106753
|
-
imports.wbg.__wbindgen_function_table = function() {
|
|
106787
|
+
imports.wbg.__wbindgen_function_table = function () {
|
|
106754
106788
|
const ret = wasm.__wbindgen_export_2;
|
|
106755
106789
|
return addHeapObject(ret);
|
|
106756
106790
|
};
|
|
@@ -204571,6 +204605,195 @@ var TruveraWebWallet = (function () {
|
|
|
204571
204605
|
}
|
|
204572
204606
|
const didService = new DIDService();
|
|
204573
204607
|
|
|
204608
|
+
var hkdf_1;
|
|
204609
|
+
var hasRequiredHkdf;
|
|
204610
|
+
|
|
204611
|
+
function requireHkdf () {
|
|
204612
|
+
if (hasRequiredHkdf) return hkdf_1;
|
|
204613
|
+
hasRequiredHkdf = 1;
|
|
204614
|
+
|
|
204615
|
+
/**
|
|
204616
|
+
* @file
|
|
204617
|
+
*
|
|
204618
|
+
* Copyright 2018 FutoIn Project (https://futoin.org)
|
|
204619
|
+
* Copyright 2018 Andrey Galkin <andrey@futoin.org>
|
|
204620
|
+
*
|
|
204621
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
204622
|
+
* you may not use this file except in compliance with the License.
|
|
204623
|
+
* You may obtain a copy of the License at
|
|
204624
|
+
*
|
|
204625
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
204626
|
+
*
|
|
204627
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
204628
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
204629
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
204630
|
+
* See the License for the specific language governing permissions and
|
|
204631
|
+
* limitations under the License.
|
|
204632
|
+
*/
|
|
204633
|
+
|
|
204634
|
+
const { Buffer } = requireBuffer$1();
|
|
204635
|
+
const { createHash, createHmac } = requireCryptoBrowserify();
|
|
204636
|
+
|
|
204637
|
+
const g_digestLenCache = {};
|
|
204638
|
+
|
|
204639
|
+
/**
|
|
204640
|
+
* Get expected hash length.
|
|
204641
|
+
*
|
|
204642
|
+
* @func
|
|
204643
|
+
* @alias hkdf.hash_length
|
|
204644
|
+
* @param {string} hash - Hash algorithm (as in underlying Node.js crypto library)
|
|
204645
|
+
* @returns {integer} hash digest byte length
|
|
204646
|
+
*
|
|
204647
|
+
* @note Values are hardcoded with fallback for unknown algorithms.
|
|
204648
|
+
*/
|
|
204649
|
+
const hash_length = ( hash ) => {
|
|
204650
|
+
switch ( hash ) {
|
|
204651
|
+
case 'sha256': return 32;
|
|
204652
|
+
case 'sha512': return 64;
|
|
204653
|
+
case 'sha224': return 28;
|
|
204654
|
+
case 'sha384': return 48;
|
|
204655
|
+
case 'sha3-256': return 32;
|
|
204656
|
+
case 'sha3-512': return 64;
|
|
204657
|
+
case 'sha3-224': return 28;
|
|
204658
|
+
case 'sha3-384': return 48;
|
|
204659
|
+
case 'blake2s256': return 32;
|
|
204660
|
+
case 'blake2b512': return 64;
|
|
204661
|
+
case 'sha1': return 20;
|
|
204662
|
+
case 'md5': return 16;
|
|
204663
|
+
default: {
|
|
204664
|
+
let len = g_digestLenCache[hash];
|
|
204665
|
+
|
|
204666
|
+
if ( len === undefined ) {
|
|
204667
|
+
len = createHash( hash ).digest().length;
|
|
204668
|
+
g_digestLenCache[hash] = len;
|
|
204669
|
+
}
|
|
204670
|
+
|
|
204671
|
+
return len;
|
|
204672
|
+
}
|
|
204673
|
+
}
|
|
204674
|
+
};
|
|
204675
|
+
|
|
204676
|
+
/**
|
|
204677
|
+
* HKDF extract action.
|
|
204678
|
+
*
|
|
204679
|
+
* @func
|
|
204680
|
+
* @alias hkdf.extract
|
|
204681
|
+
* @param {string} hash - Hash algorithm (as in underlying Node.js crypto library)
|
|
204682
|
+
* @param {integer} hash_len - Hash digest length
|
|
204683
|
+
* @param {Buffer|string} ikm - Initial Keying Material
|
|
204684
|
+
* @param {Buffer|string} salt - Optional salt (recommended)
|
|
204685
|
+
* @returns {Buffer} A buffer with pseudorandom key
|
|
204686
|
+
*
|
|
204687
|
+
* @note Values are hardcoded with fallback for unknown algorithms.
|
|
204688
|
+
*/
|
|
204689
|
+
const hkdf_extract = ( hash, hash_len, ikm, salt ) => {
|
|
204690
|
+
const b_ikm = Buffer.isBuffer( ikm ) ? ikm : Buffer.from( ikm );
|
|
204691
|
+
const b_salt = ( salt && salt.length ) ? Buffer.from( salt ) : Buffer.alloc( hash_len, 0 );
|
|
204692
|
+
|
|
204693
|
+
return createHmac( hash, b_salt ).update( b_ikm ).digest();
|
|
204694
|
+
};
|
|
204695
|
+
|
|
204696
|
+
/**
|
|
204697
|
+
* HKDF expand action.
|
|
204698
|
+
*
|
|
204699
|
+
* @func
|
|
204700
|
+
* @alias hkdf.expand
|
|
204701
|
+
* @param {string} hash - Hash algorithm (as in underlying Node.js crypto library)
|
|
204702
|
+
* @param {integer} hash_len - Hash digest length
|
|
204703
|
+
* @param {Buffer|string} prk - A buffer with pseudorandom key
|
|
204704
|
+
* @param {integer} length - length of output keying material in octets
|
|
204705
|
+
* @param {Buffer|string} info - Optional context (safe to skip)
|
|
204706
|
+
* @returns {Buffer} A buffer with output keying material
|
|
204707
|
+
*
|
|
204708
|
+
* @note Values are hardcoded with fallback for unknown algorithms.
|
|
204709
|
+
*/
|
|
204710
|
+
const hkdf_expand = ( hash, hash_len, prk, length, info ) => {
|
|
204711
|
+
const b_info = Buffer.isBuffer( info ) ? info : Buffer.from( info || '' );
|
|
204712
|
+
const info_len = b_info.length;
|
|
204713
|
+
|
|
204714
|
+
const steps = Math.ceil( length / hash_len );
|
|
204715
|
+
|
|
204716
|
+
if ( steps > 0xFF ) {
|
|
204717
|
+
throw new Error( `OKM length ${length} is too long for ${hash} hash` );
|
|
204718
|
+
}
|
|
204719
|
+
|
|
204720
|
+
// use single buffer with unnecessary create/copy/move operations
|
|
204721
|
+
const t = Buffer.alloc( hash_len * steps + info_len + 1 );
|
|
204722
|
+
|
|
204723
|
+
for ( let c = 1, start = 0, end = 0; c <= steps; ++c ) {
|
|
204724
|
+
// add info
|
|
204725
|
+
b_info.copy( t, end );
|
|
204726
|
+
// add counter
|
|
204727
|
+
t[ end + info_len ] = c;
|
|
204728
|
+
|
|
204729
|
+
createHmac( hash, prk )
|
|
204730
|
+
// use view: T(C) = T(C-1) | info | C
|
|
204731
|
+
.update( t.slice( start, end + info_len + 1 ) )
|
|
204732
|
+
.digest()
|
|
204733
|
+
// put back to the same buffer
|
|
204734
|
+
.copy( t, end );
|
|
204735
|
+
|
|
204736
|
+
start = end; // used for T(C-1) start
|
|
204737
|
+
end += hash_len; // used for T(C-1) end & overall end
|
|
204738
|
+
}
|
|
204739
|
+
|
|
204740
|
+
return t.slice( 0, length );
|
|
204741
|
+
};
|
|
204742
|
+
|
|
204743
|
+
/**
|
|
204744
|
+
* HMAC-based Extract-and-Expand Key Derivation Function (HKDF)
|
|
204745
|
+
*
|
|
204746
|
+
* @param {Buffer|string} ikm - Initial Keying Material
|
|
204747
|
+
* @param {integer} length - Required byte length of output
|
|
204748
|
+
* @param {Buffer|string} salt='' - Optional salt (recommended)
|
|
204749
|
+
* @param {Buffer|string} info='' - Optional context (safe to skip)
|
|
204750
|
+
* @param {string} hash='SHA-256' - HMAC hash function to use
|
|
204751
|
+
* @returns {Buffer} Raw buffer with derived key of @p length bytes
|
|
204752
|
+
*/
|
|
204753
|
+
function hkdf( ikm, length, { salt='', info='', hash='SHA-256' } = {} ) {
|
|
204754
|
+
hash = hash.toLowerCase().replace( '-', '' );
|
|
204755
|
+
|
|
204756
|
+
// 0. Hash length
|
|
204757
|
+
const hash_len = hash_length( hash );
|
|
204758
|
+
|
|
204759
|
+
// 1. extract
|
|
204760
|
+
const prk = hkdf_extract( hash, hash_len, ikm, salt );
|
|
204761
|
+
|
|
204762
|
+
// 2. expand
|
|
204763
|
+
return hkdf_expand( hash, hash_len, prk, length, info );
|
|
204764
|
+
}
|
|
204765
|
+
|
|
204766
|
+
Object.defineProperties( hkdf, {
|
|
204767
|
+
hash_length : {
|
|
204768
|
+
configurable: false,
|
|
204769
|
+
enumerable: false,
|
|
204770
|
+
writable: false,
|
|
204771
|
+
value: hash_length,
|
|
204772
|
+
},
|
|
204773
|
+
extract : {
|
|
204774
|
+
configurable: false,
|
|
204775
|
+
enumerable: false,
|
|
204776
|
+
writable: false,
|
|
204777
|
+
value: hkdf_extract,
|
|
204778
|
+
},
|
|
204779
|
+
expand : {
|
|
204780
|
+
configurable: false,
|
|
204781
|
+
enumerable: false,
|
|
204782
|
+
writable: false,
|
|
204783
|
+
value: hkdf_expand,
|
|
204784
|
+
},
|
|
204785
|
+
} );
|
|
204786
|
+
|
|
204787
|
+
hkdf_1 = hkdf;
|
|
204788
|
+
return hkdf_1;
|
|
204789
|
+
}
|
|
204790
|
+
|
|
204791
|
+
var hkdfExports = requireHkdf();
|
|
204792
|
+
var hkdf = /*@__PURE__*/getDefaultExportFromCjs(hkdfExports);
|
|
204793
|
+
|
|
204794
|
+
const HKDF_LENGTH = 32;
|
|
204795
|
+
const HKDF_HASH = 'SHA-256';
|
|
204796
|
+
|
|
204574
204797
|
/**
|
|
204575
204798
|
* Service class for managing Encrypted Data Vaults
|
|
204576
204799
|
* @class
|
|
@@ -204586,7 +204809,7 @@ var TruveraWebWallet = (function () {
|
|
|
204586
204809
|
_defineProperty(this, "storageInterface", void 0);
|
|
204587
204810
|
_defineProperty(this, "insertQueue", Promise.resolve());
|
|
204588
204811
|
_defineProperty(this, "controller", void 0);
|
|
204589
|
-
_defineProperty(this, "rpcMethods", [EDVService.prototype.generateKeys, EDVService.prototype.deriveKeys, EDVService.prototype.getController, EDVService.prototype.initialize, EDVService.prototype.find, EDVService.prototype.update, EDVService.prototype.insert, EDVService.prototype.delete]);
|
|
204812
|
+
_defineProperty(this, "rpcMethods", [EDVService.prototype.generateKeys, EDVService.prototype.deriveKeys, EDVService.prototype.getController, EDVService.prototype.initialize, EDVService.prototype.find, EDVService.prototype.update, EDVService.prototype.insert, EDVService.prototype.delete, EDVService.prototype.deriveBiometricKey, EDVService.prototype.deriveBiometricEncryptionKey, EDVService.prototype.encryptMasterKey, EDVService.prototype.decryptMasterKey]);
|
|
204590
204813
|
this.name = serviceName$5;
|
|
204591
204814
|
}
|
|
204592
204815
|
|
|
@@ -204813,6 +205036,91 @@ var TruveraWebWallet = (function () {
|
|
|
204813
205036
|
delete(params) {
|
|
204814
205037
|
return this.storageInterface.delete(params);
|
|
204815
205038
|
}
|
|
205039
|
+
|
|
205040
|
+
/**
|
|
205041
|
+
* Derives a key from biometric data using HKDF
|
|
205042
|
+
* @param {Buffer} biometricData - Biometric data from provider
|
|
205043
|
+
* @param {string} identifier - User's identifier as salt (email, phone number, etc.)
|
|
205044
|
+
* @returns {Buffer} Derived key
|
|
205045
|
+
* @example
|
|
205046
|
+
* const key = edvService.deriveBiometricKey(biometricData, 'user@example.com');
|
|
205047
|
+
*/
|
|
205048
|
+
deriveBiometricKey(biometricData, identifier) {
|
|
205049
|
+
const salt = identifier;
|
|
205050
|
+
return hkdf(biometricData, HKDF_LENGTH, {
|
|
205051
|
+
salt,
|
|
205052
|
+
hash: HKDF_HASH
|
|
205053
|
+
});
|
|
205054
|
+
}
|
|
205055
|
+
|
|
205056
|
+
/**
|
|
205057
|
+
* Generates a key for encrypting/decrypting the master key
|
|
205058
|
+
* @param {Buffer} biometricData - Biometric data from provider
|
|
205059
|
+
* @param {string} identifier - User's identifier as salt (email, phone number, etc.)
|
|
205060
|
+
* @returns {Promise<Object>} Encryption key and IV for AES encryption
|
|
205061
|
+
* @returns {Buffer} returns.key - Encryption key
|
|
205062
|
+
* @returns {Buffer} returns.iv - Initialization vector
|
|
205063
|
+
* @example
|
|
205064
|
+
* const { key, iv } = await edvService.deriveBiometricEncryptionKey(biometricData, 'user@example.com');
|
|
205065
|
+
*/
|
|
205066
|
+
async deriveBiometricEncryptionKey(biometricData, identifier) {
|
|
205067
|
+
const key = this.deriveBiometricKey(biometricData, identifier);
|
|
205068
|
+
const randomBytes = crypto$7.getRandomValues(new Uint8Array(16));
|
|
205069
|
+
const iv = bufferExports.Buffer.from(randomBytes);
|
|
205070
|
+
return {
|
|
205071
|
+
key,
|
|
205072
|
+
iv
|
|
205073
|
+
};
|
|
205074
|
+
}
|
|
205075
|
+
|
|
205076
|
+
/**
|
|
205077
|
+
* Encrypts the master key using a key derived from biometric data
|
|
205078
|
+
* @param {Uint8Array} masterKey - The CloudWalletVault master key to encrypt
|
|
205079
|
+
* @param {Buffer} encryptionKey - Key derived from biometric data
|
|
205080
|
+
* @param {Buffer} iv - Initialization vector
|
|
205081
|
+
* @returns {Promise<Uint8Array>} Encrypted master key
|
|
205082
|
+
* @example
|
|
205083
|
+
* const encrypted = await edvService.encryptMasterKey(masterKey, encryptionKey, iv);
|
|
205084
|
+
*/
|
|
205085
|
+
async encryptMasterKey(masterKey, encryptionKey, iv) {
|
|
205086
|
+
const keyData = new Uint8Array(encryptionKey);
|
|
205087
|
+
const ivData = new Uint8Array(iv);
|
|
205088
|
+
const key = await crypto$7.subtle.importKey('raw', keyData, {
|
|
205089
|
+
name: 'AES-GCM'
|
|
205090
|
+
}, false, ['encrypt']);
|
|
205091
|
+
const encryptedBuffer = await crypto$7.subtle.encrypt({
|
|
205092
|
+
name: 'AES-GCM',
|
|
205093
|
+
iv: ivData
|
|
205094
|
+
}, key, masterKey);
|
|
205095
|
+
return new Uint8Array(encryptedBuffer);
|
|
205096
|
+
}
|
|
205097
|
+
|
|
205098
|
+
/**
|
|
205099
|
+
* Decrypts the master key using biometric-derived key
|
|
205100
|
+
* @param {Uint8Array} encryptedKey - The encrypted master key
|
|
205101
|
+
* @param {Buffer} decryptionKey - Key derived from biometric data
|
|
205102
|
+
* @param {Buffer} iv - Initialization vector
|
|
205103
|
+
* @returns {Promise<Uint8Array>} The decrypted master key
|
|
205104
|
+
* @throws {Error} If decryption fails
|
|
205105
|
+
* @example
|
|
205106
|
+
* const masterKey = await edvService.decryptMasterKey(encryptedKey, decryptionKey, iv);
|
|
205107
|
+
*/
|
|
205108
|
+
async decryptMasterKey(encryptedKey, decryptionKey, iv) {
|
|
205109
|
+
try {
|
|
205110
|
+
const keyData = new Uint8Array(decryptionKey);
|
|
205111
|
+
const ivData = new Uint8Array(iv);
|
|
205112
|
+
const key = await crypto$7.subtle.importKey('raw', keyData, {
|
|
205113
|
+
name: 'AES-GCM'
|
|
205114
|
+
}, false, ['decrypt']);
|
|
205115
|
+
const decryptedBuffer = await crypto$7.subtle.decrypt({
|
|
205116
|
+
name: 'AES-GCM',
|
|
205117
|
+
iv: ivData
|
|
205118
|
+
}, key, encryptedKey);
|
|
205119
|
+
return new Uint8Array(decryptedBuffer);
|
|
205120
|
+
} catch (error) {
|
|
205121
|
+
throw new Error('Decryption failed: Invalid key or corrupted data');
|
|
205122
|
+
}
|
|
205123
|
+
}
|
|
204816
205124
|
}
|
|
204817
205125
|
|
|
204818
205126
|
/**
|
|
@@ -204851,206 +205159,6 @@ var TruveraWebWallet = (function () {
|
|
|
204851
205159
|
*/
|
|
204852
205160
|
const edvService = new EDVService();
|
|
204853
205161
|
|
|
204854
|
-
var hkdf_1;
|
|
204855
|
-
var hasRequiredHkdf;
|
|
204856
|
-
|
|
204857
|
-
function requireHkdf () {
|
|
204858
|
-
if (hasRequiredHkdf) return hkdf_1;
|
|
204859
|
-
hasRequiredHkdf = 1;
|
|
204860
|
-
|
|
204861
|
-
/**
|
|
204862
|
-
* @file
|
|
204863
|
-
*
|
|
204864
|
-
* Copyright 2018 FutoIn Project (https://futoin.org)
|
|
204865
|
-
* Copyright 2018 Andrey Galkin <andrey@futoin.org>
|
|
204866
|
-
*
|
|
204867
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
204868
|
-
* you may not use this file except in compliance with the License.
|
|
204869
|
-
* You may obtain a copy of the License at
|
|
204870
|
-
*
|
|
204871
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
204872
|
-
*
|
|
204873
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
204874
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
204875
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
204876
|
-
* See the License for the specific language governing permissions and
|
|
204877
|
-
* limitations under the License.
|
|
204878
|
-
*/
|
|
204879
|
-
|
|
204880
|
-
const { Buffer } = requireBuffer$1();
|
|
204881
|
-
const { createHash, createHmac } = requireCryptoBrowserify();
|
|
204882
|
-
|
|
204883
|
-
const g_digestLenCache = {};
|
|
204884
|
-
|
|
204885
|
-
/**
|
|
204886
|
-
* Get expected hash length.
|
|
204887
|
-
*
|
|
204888
|
-
* @func
|
|
204889
|
-
* @alias hkdf.hash_length
|
|
204890
|
-
* @param {string} hash - Hash algorithm (as in underlying Node.js crypto library)
|
|
204891
|
-
* @returns {integer} hash digest byte length
|
|
204892
|
-
*
|
|
204893
|
-
* @note Values are hardcoded with fallback for unknown algorithms.
|
|
204894
|
-
*/
|
|
204895
|
-
const hash_length = ( hash ) => {
|
|
204896
|
-
switch ( hash ) {
|
|
204897
|
-
case 'sha256': return 32;
|
|
204898
|
-
case 'sha512': return 64;
|
|
204899
|
-
case 'sha224': return 28;
|
|
204900
|
-
case 'sha384': return 48;
|
|
204901
|
-
case 'sha3-256': return 32;
|
|
204902
|
-
case 'sha3-512': return 64;
|
|
204903
|
-
case 'sha3-224': return 28;
|
|
204904
|
-
case 'sha3-384': return 48;
|
|
204905
|
-
case 'blake2s256': return 32;
|
|
204906
|
-
case 'blake2b512': return 64;
|
|
204907
|
-
case 'sha1': return 20;
|
|
204908
|
-
case 'md5': return 16;
|
|
204909
|
-
default: {
|
|
204910
|
-
let len = g_digestLenCache[hash];
|
|
204911
|
-
|
|
204912
|
-
if ( len === undefined ) {
|
|
204913
|
-
len = createHash( hash ).digest().length;
|
|
204914
|
-
g_digestLenCache[hash] = len;
|
|
204915
|
-
}
|
|
204916
|
-
|
|
204917
|
-
return len;
|
|
204918
|
-
}
|
|
204919
|
-
}
|
|
204920
|
-
};
|
|
204921
|
-
|
|
204922
|
-
/**
|
|
204923
|
-
* HKDF extract action.
|
|
204924
|
-
*
|
|
204925
|
-
* @func
|
|
204926
|
-
* @alias hkdf.extract
|
|
204927
|
-
* @param {string} hash - Hash algorithm (as in underlying Node.js crypto library)
|
|
204928
|
-
* @param {integer} hash_len - Hash digest length
|
|
204929
|
-
* @param {Buffer|string} ikm - Initial Keying Material
|
|
204930
|
-
* @param {Buffer|string} salt - Optional salt (recommended)
|
|
204931
|
-
* @returns {Buffer} A buffer with pseudorandom key
|
|
204932
|
-
*
|
|
204933
|
-
* @note Values are hardcoded with fallback for unknown algorithms.
|
|
204934
|
-
*/
|
|
204935
|
-
const hkdf_extract = ( hash, hash_len, ikm, salt ) => {
|
|
204936
|
-
const b_ikm = Buffer.isBuffer( ikm ) ? ikm : Buffer.from( ikm );
|
|
204937
|
-
const b_salt = ( salt && salt.length ) ? Buffer.from( salt ) : Buffer.alloc( hash_len, 0 );
|
|
204938
|
-
|
|
204939
|
-
return createHmac( hash, b_salt ).update( b_ikm ).digest();
|
|
204940
|
-
};
|
|
204941
|
-
|
|
204942
|
-
/**
|
|
204943
|
-
* HKDF expand action.
|
|
204944
|
-
*
|
|
204945
|
-
* @func
|
|
204946
|
-
* @alias hkdf.expand
|
|
204947
|
-
* @param {string} hash - Hash algorithm (as in underlying Node.js crypto library)
|
|
204948
|
-
* @param {integer} hash_len - Hash digest length
|
|
204949
|
-
* @param {Buffer|string} prk - A buffer with pseudorandom key
|
|
204950
|
-
* @param {integer} length - length of output keying material in octets
|
|
204951
|
-
* @param {Buffer|string} info - Optional context (safe to skip)
|
|
204952
|
-
* @returns {Buffer} A buffer with output keying material
|
|
204953
|
-
*
|
|
204954
|
-
* @note Values are hardcoded with fallback for unknown algorithms.
|
|
204955
|
-
*/
|
|
204956
|
-
const hkdf_expand = ( hash, hash_len, prk, length, info ) => {
|
|
204957
|
-
const b_info = Buffer.isBuffer( info ) ? info : Buffer.from( info || '' );
|
|
204958
|
-
const info_len = b_info.length;
|
|
204959
|
-
|
|
204960
|
-
const steps = Math.ceil( length / hash_len );
|
|
204961
|
-
|
|
204962
|
-
if ( steps > 0xFF ) {
|
|
204963
|
-
throw new Error( `OKM length ${length} is too long for ${hash} hash` );
|
|
204964
|
-
}
|
|
204965
|
-
|
|
204966
|
-
// use single buffer with unnecessary create/copy/move operations
|
|
204967
|
-
const t = Buffer.alloc( hash_len * steps + info_len + 1 );
|
|
204968
|
-
|
|
204969
|
-
for ( let c = 1, start = 0, end = 0; c <= steps; ++c ) {
|
|
204970
|
-
// add info
|
|
204971
|
-
b_info.copy( t, end );
|
|
204972
|
-
// add counter
|
|
204973
|
-
t[ end + info_len ] = c;
|
|
204974
|
-
|
|
204975
|
-
createHmac( hash, prk )
|
|
204976
|
-
// use view: T(C) = T(C-1) | info | C
|
|
204977
|
-
.update( t.slice( start, end + info_len + 1 ) )
|
|
204978
|
-
.digest()
|
|
204979
|
-
// put back to the same buffer
|
|
204980
|
-
.copy( t, end );
|
|
204981
|
-
|
|
204982
|
-
start = end; // used for T(C-1) start
|
|
204983
|
-
end += hash_len; // used for T(C-1) end & overall end
|
|
204984
|
-
}
|
|
204985
|
-
|
|
204986
|
-
return t.slice( 0, length );
|
|
204987
|
-
};
|
|
204988
|
-
|
|
204989
|
-
/**
|
|
204990
|
-
* HMAC-based Extract-and-Expand Key Derivation Function (HKDF)
|
|
204991
|
-
*
|
|
204992
|
-
* @param {Buffer|string} ikm - Initial Keying Material
|
|
204993
|
-
* @param {integer} length - Required byte length of output
|
|
204994
|
-
* @param {Buffer|string} salt='' - Optional salt (recommended)
|
|
204995
|
-
* @param {Buffer|string} info='' - Optional context (safe to skip)
|
|
204996
|
-
* @param {string} hash='SHA-256' - HMAC hash function to use
|
|
204997
|
-
* @returns {Buffer} Raw buffer with derived key of @p length bytes
|
|
204998
|
-
*/
|
|
204999
|
-
function hkdf( ikm, length, { salt='', info='', hash='SHA-256' } = {} ) {
|
|
205000
|
-
hash = hash.toLowerCase().replace( '-', '' );
|
|
205001
|
-
|
|
205002
|
-
// 0. Hash length
|
|
205003
|
-
const hash_len = hash_length( hash );
|
|
205004
|
-
|
|
205005
|
-
// 1. extract
|
|
205006
|
-
const prk = hkdf_extract( hash, hash_len, ikm, salt );
|
|
205007
|
-
|
|
205008
|
-
// 2. expand
|
|
205009
|
-
return hkdf_expand( hash, hash_len, prk, length, info );
|
|
205010
|
-
}
|
|
205011
|
-
|
|
205012
|
-
Object.defineProperties( hkdf, {
|
|
205013
|
-
hash_length : {
|
|
205014
|
-
configurable: false,
|
|
205015
|
-
enumerable: false,
|
|
205016
|
-
writable: false,
|
|
205017
|
-
value: hash_length,
|
|
205018
|
-
},
|
|
205019
|
-
extract : {
|
|
205020
|
-
configurable: false,
|
|
205021
|
-
enumerable: false,
|
|
205022
|
-
writable: false,
|
|
205023
|
-
value: hkdf_extract,
|
|
205024
|
-
},
|
|
205025
|
-
expand : {
|
|
205026
|
-
configurable: false,
|
|
205027
|
-
enumerable: false,
|
|
205028
|
-
writable: false,
|
|
205029
|
-
value: hkdf_expand,
|
|
205030
|
-
},
|
|
205031
|
-
} );
|
|
205032
|
-
|
|
205033
|
-
hkdf_1 = hkdf;
|
|
205034
|
-
return hkdf_1;
|
|
205035
|
-
}
|
|
205036
|
-
|
|
205037
|
-
requireHkdf();
|
|
205038
|
-
|
|
205039
|
-
var crypto_1;
|
|
205040
|
-
var hasRequiredCrypto$1;
|
|
205041
|
-
|
|
205042
|
-
function requireCrypto$1 () {
|
|
205043
|
-
if (hasRequiredCrypto$1) return crypto_1;
|
|
205044
|
-
hasRequiredCrypto$1 = 1;
|
|
205045
|
-
|
|
205046
|
-
var webcrypto = webcrypto_es;
|
|
205047
|
-
var crypto = new webcrypto.Crypto();
|
|
205048
|
-
crypto_1 = crypto;
|
|
205049
|
-
return crypto_1;
|
|
205050
|
-
}
|
|
205051
|
-
|
|
205052
|
-
requireCrypto$1();
|
|
205053
|
-
|
|
205054
205162
|
const crypto$2 = typeof globalThis === 'object' && 'crypto' in globalThis ? globalThis.crypto : undefined;
|
|
205055
205163
|
|
|
205056
205164
|
/**
|
|
@@ -482112,7 +482220,7 @@ zoo`.split('\n');
|
|
|
482112
482220
|
value: true
|
|
482113
482221
|
});
|
|
482114
482222
|
|
|
482115
|
-
var crypto = requireCrypto$
|
|
482223
|
+
var crypto = requireCrypto$1();
|
|
482116
482224
|
|
|
482117
482225
|
|
|
482118
482226
|
|
|
@@ -482163,7 +482271,7 @@ zoo`.split('\n');
|
|
|
482163
482271
|
|
|
482164
482272
|
var constants = requireConstants();
|
|
482165
482273
|
|
|
482166
|
-
requireCrypto$
|
|
482274
|
+
requireCrypto$1();
|
|
482167
482275
|
|
|
482168
482276
|
var methods_contentsCrypto = requireContentsCrypto();
|
|
482169
482277
|
|
|
@@ -482399,7 +482507,7 @@ zoo`.split('\n');
|
|
|
482399
482507
|
|
|
482400
482508
|
requireConstants();
|
|
482401
482509
|
|
|
482402
|
-
requireCrypto$
|
|
482510
|
+
requireCrypto$1();
|
|
482403
482511
|
|
|
482404
482512
|
requireContentsCrypto();
|
|
482405
482513
|
|
|
@@ -538276,10 +538384,10 @@ zoo`.split('\n');
|
|
|
538276
538384
|
const EPSILON_INT = 1;
|
|
538277
538385
|
const MAX_DATE_PLACEHOLDER = 884541351600000;
|
|
538278
538386
|
const MIN_DATE_PLACEHOLDER = -17592186044415;
|
|
538279
|
-
const MAX_INTEGER =
|
|
538280
|
-
const MIN_INTEGER =
|
|
538281
|
-
const MAX_NUMBER =
|
|
538282
|
-
const MIN_NUMBER =
|
|
538387
|
+
const MAX_INTEGER = Number.MAX_SAFE_INTEGER;
|
|
538388
|
+
const MIN_INTEGER = Number.MIN_SAFE_INTEGER;
|
|
538389
|
+
const MAX_NUMBER = Number.MAX_SAFE_INTEGER;
|
|
538390
|
+
const MIN_NUMBER = Number.MIN_SAFE_INTEGER;
|
|
538283
538391
|
|
|
538284
538392
|
/*
|
|
538285
538393
|
PEX Filter rules:
|
|
@@ -562262,32 +562370,7 @@ zoo`.split('\n');
|
|
|
562262
562370
|
* @param params - Delegation parameters
|
|
562263
562371
|
* @returns Signed delegation credential
|
|
562264
562372
|
*/
|
|
562265
|
-
async function issueDelegationCredential(keyPair,
|
|
562266
|
-
const {
|
|
562267
|
-
id,
|
|
562268
|
-
issuerDid,
|
|
562269
|
-
delegateDid,
|
|
562270
|
-
mayClaim,
|
|
562271
|
-
context,
|
|
562272
|
-
types,
|
|
562273
|
-
additionalSubjectProperties = {},
|
|
562274
|
-
previousCredentialId = null,
|
|
562275
|
-
rootCredentialId
|
|
562276
|
-
} = params;
|
|
562277
|
-
const credential = {
|
|
562278
|
-
'@context': context,
|
|
562279
|
-
id,
|
|
562280
|
-
type: types,
|
|
562281
|
-
issuer: issuerDid,
|
|
562282
|
-
issuanceDate: new Date().toISOString(),
|
|
562283
|
-
credentialSubject: {
|
|
562284
|
-
id: delegateDid,
|
|
562285
|
-
[MAY_CLAIM_IRI]: mayClaim,
|
|
562286
|
-
...additionalSubjectProperties
|
|
562287
|
-
},
|
|
562288
|
-
rootCredentialId: undefined,
|
|
562289
|
-
previousCredentialId
|
|
562290
|
-
};
|
|
562373
|
+
async function issueDelegationCredential(keyPair, credential) {
|
|
562291
562374
|
const preparedKey = prepareKeyForSigning(keyPair);
|
|
562292
562375
|
return issueCredential(preparedKey, credential);
|
|
562293
562376
|
}
|
|
@@ -562298,30 +562381,7 @@ zoo`.split('\n');
|
|
|
562298
562381
|
* @param params - Credential parameters
|
|
562299
562382
|
* @returns Signed credential
|
|
562300
562383
|
*/
|
|
562301
|
-
async function issueDelegatedCredential(keyPair,
|
|
562302
|
-
const {
|
|
562303
|
-
id,
|
|
562304
|
-
issuerDid,
|
|
562305
|
-
subjectDid,
|
|
562306
|
-
claims,
|
|
562307
|
-
rootCredentialId,
|
|
562308
|
-
previousCredentialId,
|
|
562309
|
-
context,
|
|
562310
|
-
types
|
|
562311
|
-
} = params;
|
|
562312
|
-
const credential = {
|
|
562313
|
-
'@context': context,
|
|
562314
|
-
id,
|
|
562315
|
-
type: types,
|
|
562316
|
-
issuer: issuerDid,
|
|
562317
|
-
issuanceDate: new Date().toISOString(),
|
|
562318
|
-
credentialSubject: {
|
|
562319
|
-
id: subjectDid,
|
|
562320
|
-
...claims
|
|
562321
|
-
},
|
|
562322
|
-
rootCredentialId,
|
|
562323
|
-
previousCredentialId
|
|
562324
|
-
};
|
|
562384
|
+
async function issueDelegatedCredential(keyPair, credential) {
|
|
562325
562385
|
const preparedKey = prepareKeyForSigning(keyPair);
|
|
562326
562386
|
return issueCredential(preparedKey, credential);
|
|
562327
562387
|
}
|
|
@@ -568052,33 +568112,6 @@ zoo`.split('\n');
|
|
|
568052
568112
|
throw new Error("Failed to create data store: ".concat(error.message));
|
|
568053
568113
|
}
|
|
568054
568114
|
|
|
568055
|
-
// Initialize wallet
|
|
568056
|
-
let wallet;
|
|
568057
|
-
try {
|
|
568058
|
-
wallet = await createWallet({
|
|
568059
|
-
dataStore
|
|
568060
|
-
});
|
|
568061
|
-
} catch (error) {
|
|
568062
|
-
throw new Error("Failed to create wallet: ".concat(error.message));
|
|
568063
|
-
}
|
|
568064
|
-
|
|
568065
|
-
// Initialize providers
|
|
568066
|
-
let didProvider, credentialProvider, messageProvider;
|
|
568067
|
-
try {
|
|
568068
|
-
didProvider = createDIDProvider({
|
|
568069
|
-
wallet
|
|
568070
|
-
});
|
|
568071
|
-
credentialProvider = await createCredentialProvider({
|
|
568072
|
-
wallet
|
|
568073
|
-
});
|
|
568074
|
-
messageProvider = createMessageProvider({
|
|
568075
|
-
wallet,
|
|
568076
|
-
didProvider
|
|
568077
|
-
});
|
|
568078
|
-
} catch (error) {
|
|
568079
|
-
throw new Error("Failed to initialize wallet providers: ".concat(error.message));
|
|
568080
|
-
}
|
|
568081
|
-
|
|
568082
568115
|
// Recover or set master key
|
|
568083
568116
|
if (mnemonic) {
|
|
568084
568117
|
try {
|
|
@@ -568088,7 +568121,9 @@ zoo`.split('\n');
|
|
|
568088
568121
|
}
|
|
568089
568122
|
}
|
|
568090
568123
|
|
|
568091
|
-
// Initialize cloud wallet
|
|
568124
|
+
// Initialize cloud wallet and pull documents before creating the wallet
|
|
568125
|
+
// This ensures existing DIDs are loaded from the cloud before wallet creation,
|
|
568126
|
+
// preventing duplicate DID creation
|
|
568092
568127
|
let cloudWallet;
|
|
568093
568128
|
try {
|
|
568094
568129
|
cloudWallet = await initializeCloudWallet({
|
|
@@ -568107,6 +568142,33 @@ zoo`.split('\n');
|
|
|
568107
568142
|
} catch (error) {
|
|
568108
568143
|
console.warn('Warning: Failed to pull documents from cloud wallet. You may need to sync manually.', error.message);
|
|
568109
568144
|
}
|
|
568145
|
+
|
|
568146
|
+
// Initialize wallet after cloud sync so existing DIDs are found in the data store
|
|
568147
|
+
let wallet;
|
|
568148
|
+
try {
|
|
568149
|
+
wallet = await createWallet({
|
|
568150
|
+
dataStore
|
|
568151
|
+
});
|
|
568152
|
+
} catch (error) {
|
|
568153
|
+
throw new Error("Failed to create wallet: ".concat(error.message));
|
|
568154
|
+
}
|
|
568155
|
+
|
|
568156
|
+
// Initialize providers
|
|
568157
|
+
let didProvider, credentialProvider, messageProvider;
|
|
568158
|
+
try {
|
|
568159
|
+
didProvider = createDIDProvider({
|
|
568160
|
+
wallet
|
|
568161
|
+
});
|
|
568162
|
+
credentialProvider = await createCredentialProvider({
|
|
568163
|
+
wallet
|
|
568164
|
+
});
|
|
568165
|
+
messageProvider = createMessageProvider({
|
|
568166
|
+
wallet,
|
|
568167
|
+
didProvider
|
|
568168
|
+
});
|
|
568169
|
+
} catch (error) {
|
|
568170
|
+
throw new Error("Failed to initialize wallet providers: ".concat(error.message));
|
|
568171
|
+
}
|
|
568110
568172
|
return {
|
|
568111
568173
|
wallet,
|
|
568112
568174
|
messageProvider,
|
|
@@ -568200,13 +568262,9 @@ zoo`.split('\n');
|
|
|
568200
568262
|
* const result = await wallet.submitPresentation({
|
|
568201
568263
|
* credentials: [
|
|
568202
568264
|
* {
|
|
568203
|
-
* id: '
|
|
568204
|
-
* attributesToReveal: ['
|
|
568265
|
+
* id: 'https://creds-testnet.truvera.io/c7f3e722287d1ea98c136ad5df8066209c5e9b44c6251af0860d62e9a3a21a76',
|
|
568266
|
+
* attributesToReveal: ['credentialSubject.fullName', 'credentialSubject.age']
|
|
568205
568267
|
* },
|
|
568206
|
-
* {
|
|
568207
|
-
* id: 'credential-456',
|
|
568208
|
-
* attributesToReveal: ['email']
|
|
568209
|
-
* }
|
|
568210
568268
|
* ],
|
|
568211
568269
|
* proofRequestUrl: 'https://creds-staging.truvera.io/proof/77ae2c67-678e-4cb6-8c5d-a4dd4a1a19f1'
|
|
568212
568270
|
* });
|
|
@@ -568216,6 +568274,9 @@ zoo`.split('\n');
|
|
|
568216
568274
|
credentials,
|
|
568217
568275
|
proofRequestUrl
|
|
568218
568276
|
} = _ref2;
|
|
568277
|
+
// ensure blockchain is connected
|
|
568278
|
+
await blockchainService.ensureBlockchainReady();
|
|
568279
|
+
|
|
568219
568280
|
// Validate inputs
|
|
568220
568281
|
if (!credentials || !Array.isArray(credentials) || credentials.length === 0) {
|
|
568221
568282
|
throw new Error('Invalid credentials: Must provide a non-empty array of credentials');
|