@learncard/react 2.3.15 → 2.3.18
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/cjs/{VCCard-2983ff1d.js → VCCard-ef452696.js} +710 -1246
- package/dist/{esm/VCCard-779741a4.js.map → cjs/VCCard-ef452696.js.map} +1 -1
- package/dist/cjs/{VCDisplayBackFace-d0d79b7a.js → VCDisplayBackFace-fb1b9350.js} +36 -8
- package/dist/cjs/VCDisplayBackFace-fb1b9350.js.map +1 -0
- package/dist/cjs/{VCDisplayCard-36a39706.js → VCDisplayCard-e58bd47e.js} +9 -28
- package/dist/cjs/VCDisplayCard-e58bd47e.js.map +1 -0
- package/dist/cjs/index.js +3 -3
- package/dist/cjs/index15.js +3 -3
- package/dist/cjs/index16.js +1 -1
- package/dist/cjs/index17.js +2 -2
- package/dist/cjs/index5.js +3 -3
- package/dist/esm/{VCCard-779741a4.js → VCCard-9a58a5f4.js} +710 -1246
- package/dist/{cjs/VCCard-2983ff1d.js.map → esm/VCCard-9a58a5f4.js.map} +1 -1
- package/dist/esm/{VCDisplayBackFace-4ffe5733.js → VCDisplayBackFace-d603e35b.js} +35 -9
- package/dist/esm/VCDisplayBackFace-d603e35b.js.map +1 -0
- package/dist/esm/{VCDisplayCard-6b0274f9.js → VCDisplayCard-d9ff62dc.js} +5 -24
- package/dist/esm/VCDisplayCard-d9ff62dc.js.map +1 -0
- package/dist/esm/index.js +3 -3
- package/dist/esm/index15.js +3 -3
- package/dist/esm/index16.js +1 -1
- package/dist/esm/index17.js +2 -2
- package/dist/esm/index5.js +3 -3
- package/dist/main.css +1 -1
- package/dist/main.js +1 -1
- package/package.json +2 -2
- package/dist/cjs/VCDisplayBackFace-d0d79b7a.js.map +0 -1
- package/dist/cjs/VCDisplayCard-36a39706.js.map +0 -1
- package/dist/esm/VCDisplayBackFace-4ffe5733.js.map +0 -1
- package/dist/esm/VCDisplayCard-6b0274f9.js.map +0 -1
|
@@ -9,7 +9,7 @@ var https = require('https');
|
|
|
9
9
|
var zlib = require('zlib');
|
|
10
10
|
var crypto__default = require('crypto');
|
|
11
11
|
var process$1 = require('process');
|
|
12
|
-
var VCDisplayCard = require('./VCDisplayCard-
|
|
12
|
+
var VCDisplayCard = require('./VCDisplayCard-e58bd47e.js');
|
|
13
13
|
|
|
14
14
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
15
|
|
|
@@ -143399,232 +143399,6 @@ var require_src3 = __commonJS({
|
|
|
143399
143399
|
};
|
|
143400
143400
|
}
|
|
143401
143401
|
});
|
|
143402
|
-
var require_erc20_abi = __commonJS({
|
|
143403
|
-
"src/wallet/plugins/EthereumPlugin/erc20.abi.json"(exports, module) {
|
|
143404
|
-
module.exports = [
|
|
143405
|
-
{
|
|
143406
|
-
constant: true,
|
|
143407
|
-
inputs: [],
|
|
143408
|
-
name: "name",
|
|
143409
|
-
outputs: [
|
|
143410
|
-
{
|
|
143411
|
-
name: "",
|
|
143412
|
-
type: "string"
|
|
143413
|
-
}
|
|
143414
|
-
],
|
|
143415
|
-
payable: false,
|
|
143416
|
-
stateMutability: "view",
|
|
143417
|
-
type: "function"
|
|
143418
|
-
},
|
|
143419
|
-
{
|
|
143420
|
-
constant: false,
|
|
143421
|
-
inputs: [
|
|
143422
|
-
{
|
|
143423
|
-
name: "_spender",
|
|
143424
|
-
type: "address"
|
|
143425
|
-
},
|
|
143426
|
-
{
|
|
143427
|
-
name: "_value",
|
|
143428
|
-
type: "uint256"
|
|
143429
|
-
}
|
|
143430
|
-
],
|
|
143431
|
-
name: "approve",
|
|
143432
|
-
outputs: [
|
|
143433
|
-
{
|
|
143434
|
-
name: "",
|
|
143435
|
-
type: "bool"
|
|
143436
|
-
}
|
|
143437
|
-
],
|
|
143438
|
-
payable: false,
|
|
143439
|
-
stateMutability: "nonpayable",
|
|
143440
|
-
type: "function"
|
|
143441
|
-
},
|
|
143442
|
-
{
|
|
143443
|
-
constant: true,
|
|
143444
|
-
inputs: [],
|
|
143445
|
-
name: "totalSupply",
|
|
143446
|
-
outputs: [
|
|
143447
|
-
{
|
|
143448
|
-
name: "",
|
|
143449
|
-
type: "uint256"
|
|
143450
|
-
}
|
|
143451
|
-
],
|
|
143452
|
-
payable: false,
|
|
143453
|
-
stateMutability: "view",
|
|
143454
|
-
type: "function"
|
|
143455
|
-
},
|
|
143456
|
-
{
|
|
143457
|
-
constant: false,
|
|
143458
|
-
inputs: [
|
|
143459
|
-
{
|
|
143460
|
-
name: "_from",
|
|
143461
|
-
type: "address"
|
|
143462
|
-
},
|
|
143463
|
-
{
|
|
143464
|
-
name: "_to",
|
|
143465
|
-
type: "address"
|
|
143466
|
-
},
|
|
143467
|
-
{
|
|
143468
|
-
name: "_value",
|
|
143469
|
-
type: "uint256"
|
|
143470
|
-
}
|
|
143471
|
-
],
|
|
143472
|
-
name: "transferFrom",
|
|
143473
|
-
outputs: [
|
|
143474
|
-
{
|
|
143475
|
-
name: "",
|
|
143476
|
-
type: "bool"
|
|
143477
|
-
}
|
|
143478
|
-
],
|
|
143479
|
-
payable: false,
|
|
143480
|
-
stateMutability: "nonpayable",
|
|
143481
|
-
type: "function"
|
|
143482
|
-
},
|
|
143483
|
-
{
|
|
143484
|
-
constant: true,
|
|
143485
|
-
inputs: [],
|
|
143486
|
-
name: "decimals",
|
|
143487
|
-
outputs: [
|
|
143488
|
-
{
|
|
143489
|
-
name: "",
|
|
143490
|
-
type: "uint8"
|
|
143491
|
-
}
|
|
143492
|
-
],
|
|
143493
|
-
payable: false,
|
|
143494
|
-
stateMutability: "view",
|
|
143495
|
-
type: "function"
|
|
143496
|
-
},
|
|
143497
|
-
{
|
|
143498
|
-
constant: true,
|
|
143499
|
-
inputs: [
|
|
143500
|
-
{
|
|
143501
|
-
name: "_owner",
|
|
143502
|
-
type: "address"
|
|
143503
|
-
}
|
|
143504
|
-
],
|
|
143505
|
-
name: "balanceOf",
|
|
143506
|
-
outputs: [
|
|
143507
|
-
{
|
|
143508
|
-
name: "balance",
|
|
143509
|
-
type: "uint256"
|
|
143510
|
-
}
|
|
143511
|
-
],
|
|
143512
|
-
payable: false,
|
|
143513
|
-
stateMutability: "view",
|
|
143514
|
-
type: "function"
|
|
143515
|
-
},
|
|
143516
|
-
{
|
|
143517
|
-
constant: true,
|
|
143518
|
-
inputs: [],
|
|
143519
|
-
name: "symbol",
|
|
143520
|
-
outputs: [
|
|
143521
|
-
{
|
|
143522
|
-
name: "",
|
|
143523
|
-
type: "string"
|
|
143524
|
-
}
|
|
143525
|
-
],
|
|
143526
|
-
payable: false,
|
|
143527
|
-
stateMutability: "view",
|
|
143528
|
-
type: "function"
|
|
143529
|
-
},
|
|
143530
|
-
{
|
|
143531
|
-
constant: false,
|
|
143532
|
-
inputs: [
|
|
143533
|
-
{
|
|
143534
|
-
name: "_to",
|
|
143535
|
-
type: "address"
|
|
143536
|
-
},
|
|
143537
|
-
{
|
|
143538
|
-
name: "_value",
|
|
143539
|
-
type: "uint256"
|
|
143540
|
-
}
|
|
143541
|
-
],
|
|
143542
|
-
name: "transfer",
|
|
143543
|
-
outputs: [
|
|
143544
|
-
{
|
|
143545
|
-
name: "",
|
|
143546
|
-
type: "bool"
|
|
143547
|
-
}
|
|
143548
|
-
],
|
|
143549
|
-
payable: false,
|
|
143550
|
-
stateMutability: "nonpayable",
|
|
143551
|
-
type: "function"
|
|
143552
|
-
},
|
|
143553
|
-
{
|
|
143554
|
-
constant: true,
|
|
143555
|
-
inputs: [
|
|
143556
|
-
{
|
|
143557
|
-
name: "_owner",
|
|
143558
|
-
type: "address"
|
|
143559
|
-
},
|
|
143560
|
-
{
|
|
143561
|
-
name: "_spender",
|
|
143562
|
-
type: "address"
|
|
143563
|
-
}
|
|
143564
|
-
],
|
|
143565
|
-
name: "allowance",
|
|
143566
|
-
outputs: [
|
|
143567
|
-
{
|
|
143568
|
-
name: "",
|
|
143569
|
-
type: "uint256"
|
|
143570
|
-
}
|
|
143571
|
-
],
|
|
143572
|
-
payable: false,
|
|
143573
|
-
stateMutability: "view",
|
|
143574
|
-
type: "function"
|
|
143575
|
-
},
|
|
143576
|
-
{
|
|
143577
|
-
payable: true,
|
|
143578
|
-
stateMutability: "payable",
|
|
143579
|
-
type: "fallback"
|
|
143580
|
-
},
|
|
143581
|
-
{
|
|
143582
|
-
anonymous: false,
|
|
143583
|
-
inputs: [
|
|
143584
|
-
{
|
|
143585
|
-
indexed: true,
|
|
143586
|
-
name: "owner",
|
|
143587
|
-
type: "address"
|
|
143588
|
-
},
|
|
143589
|
-
{
|
|
143590
|
-
indexed: true,
|
|
143591
|
-
name: "spender",
|
|
143592
|
-
type: "address"
|
|
143593
|
-
},
|
|
143594
|
-
{
|
|
143595
|
-
indexed: false,
|
|
143596
|
-
name: "value",
|
|
143597
|
-
type: "uint256"
|
|
143598
|
-
}
|
|
143599
|
-
],
|
|
143600
|
-
name: "Approval",
|
|
143601
|
-
type: "event"
|
|
143602
|
-
},
|
|
143603
|
-
{
|
|
143604
|
-
anonymous: false,
|
|
143605
|
-
inputs: [
|
|
143606
|
-
{
|
|
143607
|
-
indexed: true,
|
|
143608
|
-
name: "from",
|
|
143609
|
-
type: "address"
|
|
143610
|
-
},
|
|
143611
|
-
{
|
|
143612
|
-
indexed: true,
|
|
143613
|
-
name: "to",
|
|
143614
|
-
type: "address"
|
|
143615
|
-
},
|
|
143616
|
-
{
|
|
143617
|
-
indexed: false,
|
|
143618
|
-
name: "value",
|
|
143619
|
-
type: "uint256"
|
|
143620
|
-
}
|
|
143621
|
-
],
|
|
143622
|
-
name: "Transfer",
|
|
143623
|
-
type: "event"
|
|
143624
|
-
}
|
|
143625
|
-
];
|
|
143626
|
-
}
|
|
143627
|
-
});
|
|
143628
143402
|
if (typeof window === "undefined")
|
|
143629
143403
|
globalThis.crypto = crypto2;
|
|
143630
143404
|
var addPluginToWallet = /* @__PURE__ */ __name((wallet, plugin) => __async$1(void 0, null, function* () {
|
|
@@ -150645,7 +150419,7 @@ function toUint8Array(str) {
|
|
|
150645
150419
|
return new Uint8Array(bytes);
|
|
150646
150420
|
}
|
|
150647
150421
|
__name(toUint8Array, "toUint8Array");
|
|
150648
|
-
|
|
150422
|
+
__toESM(require_lib());
|
|
150649
150423
|
var import_ed255192 = __toESM(require_ed25519(), 1);
|
|
150650
150424
|
var import_fast_json_stable_stringify = __toESM(require_fast_json_stable_stringify(), 1);
|
|
150651
150425
|
var B642 = "base64pad";
|
|
@@ -155842,160 +155616,712 @@ var CeramicClient = class {
|
|
|
155842
155616
|
}
|
|
155843
155617
|
};
|
|
155844
155618
|
__name(CeramicClient, "CeramicClient");
|
|
155845
|
-
var
|
|
155846
|
-
|
|
155847
|
-
|
|
155848
|
-
|
|
155849
|
-
|
|
155850
|
-
|
|
155851
|
-
|
|
155852
|
-
|
|
155853
|
-
|
|
155854
|
-
|
|
155855
|
-
|
|
155856
|
-
|
|
155857
|
-
|
|
155858
|
-
|
|
155859
|
-
|
|
155860
|
-
|
|
155861
|
-
|
|
155862
|
-
|
|
155863
|
-
|
|
155864
|
-
|
|
155865
|
-
|
|
155866
|
-
|
|
155867
|
-
|
|
155868
|
-
|
|
155869
|
-
|
|
155870
|
-
|
|
155871
|
-
|
|
155872
|
-
|
|
155873
|
-
|
|
155874
|
-
|
|
155875
|
-
|
|
155876
|
-
|
|
155877
|
-
|
|
155878
|
-
|
|
155879
|
-
|
|
155880
|
-
|
|
155881
|
-
|
|
155882
|
-
|
|
155883
|
-
|
|
155884
|
-
const
|
|
155885
|
-
|
|
155886
|
-
|
|
155887
|
-
|
|
155888
|
-
|
|
155889
|
-
|
|
155890
|
-
|
|
155891
|
-
|
|
155892
|
-
|
|
155893
|
-
|
|
155894
|
-
|
|
155895
|
-
|
|
155896
|
-
if (!metadata.controllers)
|
|
155897
|
-
metadata.controllers = [ceramic.did.id];
|
|
155898
|
-
if (!metadata.family)
|
|
155899
|
-
metadata.family = defaultContentFamily;
|
|
155900
|
-
if (!("pin" in options))
|
|
155901
|
-
options.pin = true;
|
|
155902
|
-
const doc = yield TileDocument.create(ceramic, content, metadata, options);
|
|
155903
|
-
return doc.id.toString();
|
|
155904
|
-
}), "publishContentToCeramic");
|
|
155905
|
-
const readContentFromCeramic = /* @__PURE__ */ __name((streamId) => __async$1(void 0, null, function* () {
|
|
155906
|
-
var _a;
|
|
155907
|
-
return (_a = yield loader.load(streamId)) == null ? void 0 : _a.content;
|
|
155908
|
-
}), "readContentFromCeramic");
|
|
155619
|
+
var wasm;
|
|
155620
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
155621
|
+
cachedTextDecoder.decode();
|
|
155622
|
+
var cachegetUint8Memory0 = null;
|
|
155623
|
+
function getUint8Memory0() {
|
|
155624
|
+
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
|
155625
|
+
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
155626
|
+
}
|
|
155627
|
+
return cachegetUint8Memory0;
|
|
155628
|
+
}
|
|
155629
|
+
__name(getUint8Memory0, "getUint8Memory0");
|
|
155630
|
+
function getStringFromWasm0(ptr, len) {
|
|
155631
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
155632
|
+
}
|
|
155633
|
+
__name(getStringFromWasm0, "getStringFromWasm0");
|
|
155634
|
+
var heap = new Array(32).fill(void 0);
|
|
155635
|
+
heap.push(void 0, null, true, false);
|
|
155636
|
+
var heap_next = heap.length;
|
|
155637
|
+
function addHeapObject(obj) {
|
|
155638
|
+
if (heap_next === heap.length)
|
|
155639
|
+
heap.push(heap.length + 1);
|
|
155640
|
+
const idx = heap_next;
|
|
155641
|
+
heap_next = heap[idx];
|
|
155642
|
+
heap[idx] = obj;
|
|
155643
|
+
return idx;
|
|
155644
|
+
}
|
|
155645
|
+
__name(addHeapObject, "addHeapObject");
|
|
155646
|
+
function getObject(idx) {
|
|
155647
|
+
return heap[idx];
|
|
155648
|
+
}
|
|
155649
|
+
__name(getObject, "getObject");
|
|
155650
|
+
function dropObject(idx) {
|
|
155651
|
+
if (idx < 36)
|
|
155652
|
+
return;
|
|
155653
|
+
heap[idx] = heap_next;
|
|
155654
|
+
heap_next = idx;
|
|
155655
|
+
}
|
|
155656
|
+
__name(dropObject, "dropObject");
|
|
155657
|
+
function takeObject(idx) {
|
|
155658
|
+
const ret = getObject(idx);
|
|
155659
|
+
dropObject(idx);
|
|
155660
|
+
return ret;
|
|
155661
|
+
}
|
|
155662
|
+
__name(takeObject, "takeObject");
|
|
155663
|
+
var WASM_VECTOR_LEN = 0;
|
|
155664
|
+
var cachedTextEncoder = new TextEncoder("utf-8");
|
|
155665
|
+
var encodeString2 = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
155666
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
155667
|
+
} : function(arg, view) {
|
|
155668
|
+
const buf2 = cachedTextEncoder.encode(arg);
|
|
155669
|
+
view.set(buf2);
|
|
155909
155670
|
return {
|
|
155910
|
-
|
|
155911
|
-
|
|
155912
|
-
return getCredentialsListFromIdx(alias);
|
|
155913
|
-
}),
|
|
155914
|
-
publishContentToCeramic: (_wallet, cred) => __async$1(void 0, null, function* () {
|
|
155915
|
-
return publishContentToCeramic(cred);
|
|
155916
|
-
}),
|
|
155917
|
-
readContentFromCeramic: (_wallet, streamId) => __async$1(void 0, null, function* () {
|
|
155918
|
-
return readContentFromCeramic(streamId);
|
|
155919
|
-
}),
|
|
155920
|
-
getVerifiableCredentialFromIdx: (_wallet, title) => __async$1(void 0, null, function* () {
|
|
155921
|
-
var _a;
|
|
155922
|
-
const credentialList = yield getCredentialsListFromIdx();
|
|
155923
|
-
const credential = (_a = credentialList == null ? void 0 : credentialList.credentials) == null ? void 0 : _a.find((cred) => (cred == null ? void 0 : cred.title) === title);
|
|
155924
|
-
return credential && (yield readContentFromCeramic(credential.id));
|
|
155925
|
-
}),
|
|
155926
|
-
getVerifiableCredentialsFromIdx: () => __async$1(void 0, null, function* () {
|
|
155927
|
-
var _a, _b;
|
|
155928
|
-
const credentialList = yield getCredentialsListFromIdx();
|
|
155929
|
-
const streamIds = (_b = (_a = credentialList == null ? void 0 : credentialList.credentials) == null ? void 0 : _a.map((credential) => credential == null ? void 0 : credential.id)) != null ? _b : [];
|
|
155930
|
-
return Promise.all(streamIds.map((streamId) => __async$1(void 0, null, function* () {
|
|
155931
|
-
return readContentFromCeramic(streamId);
|
|
155932
|
-
})));
|
|
155933
|
-
}),
|
|
155934
|
-
addVerifiableCredentialInIdx: (_02, _12) => __async$1(void 0, [_02, _12], function* (_wallet, { title, id }) {
|
|
155935
|
-
return addCredentialStreamIdToIdx({ title, id });
|
|
155936
|
-
}),
|
|
155937
|
-
removeVerifiableCredentialInIdx: (_wallet, title) => __async$1(void 0, null, function* () {
|
|
155938
|
-
return removeCredentialFromIdx(title);
|
|
155939
|
-
})
|
|
155940
|
-
}
|
|
155671
|
+
read: arg.length,
|
|
155672
|
+
written: buf2.length
|
|
155941
155673
|
};
|
|
155942
|
-
}
|
|
155943
|
-
|
|
155944
|
-
|
|
155945
|
-
|
|
155946
|
-
|
|
155947
|
-
|
|
155948
|
-
|
|
155949
|
-
|
|
155950
|
-
|
|
155951
|
-
|
|
155952
|
-
|
|
155953
|
-
|
|
155954
|
-
|
|
155955
|
-
|
|
155956
|
-
|
|
155957
|
-
|
|
155958
|
-
|
|
155959
|
-
|
|
155960
|
-
|
|
155961
|
-
|
|
155962
|
-
|
|
155963
|
-
|
|
155964
|
-
|
|
155965
|
-
|
|
155966
|
-
|
|
155967
|
-
|
|
155968
|
-
|
|
155969
|
-
|
|
155970
|
-
|
|
155971
|
-
|
|
155972
|
-
|
|
155973
|
-
|
|
155974
|
-
|
|
155975
|
-
|
|
155674
|
+
};
|
|
155675
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
155676
|
+
if (realloc === void 0) {
|
|
155677
|
+
const buf2 = cachedTextEncoder.encode(arg);
|
|
155678
|
+
const ptr2 = malloc(buf2.length);
|
|
155679
|
+
getUint8Memory0().subarray(ptr2, ptr2 + buf2.length).set(buf2);
|
|
155680
|
+
WASM_VECTOR_LEN = buf2.length;
|
|
155681
|
+
return ptr2;
|
|
155682
|
+
}
|
|
155683
|
+
let len = arg.length;
|
|
155684
|
+
let ptr = malloc(len);
|
|
155685
|
+
const mem = getUint8Memory0();
|
|
155686
|
+
let offset = 0;
|
|
155687
|
+
for (; offset < len; offset++) {
|
|
155688
|
+
const code5 = arg.charCodeAt(offset);
|
|
155689
|
+
if (code5 > 127)
|
|
155690
|
+
break;
|
|
155691
|
+
mem[ptr + offset] = code5;
|
|
155692
|
+
}
|
|
155693
|
+
if (offset !== len) {
|
|
155694
|
+
if (offset !== 0) {
|
|
155695
|
+
arg = arg.slice(offset);
|
|
155696
|
+
}
|
|
155697
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
155698
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
155699
|
+
const ret = encodeString2(arg, view);
|
|
155700
|
+
offset += ret.written;
|
|
155701
|
+
}
|
|
155702
|
+
WASM_VECTOR_LEN = offset;
|
|
155703
|
+
return ptr;
|
|
155704
|
+
}
|
|
155705
|
+
__name(passStringToWasm0, "passStringToWasm0");
|
|
155706
|
+
function isLikeNone(x) {
|
|
155707
|
+
return x === void 0 || x === null;
|
|
155708
|
+
}
|
|
155709
|
+
__name(isLikeNone, "isLikeNone");
|
|
155710
|
+
var cachegetInt32Memory0 = null;
|
|
155711
|
+
function getInt32Memory0() {
|
|
155712
|
+
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
|
155713
|
+
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
155714
|
+
}
|
|
155715
|
+
return cachegetInt32Memory0;
|
|
155716
|
+
}
|
|
155717
|
+
__name(getInt32Memory0, "getInt32Memory0");
|
|
155718
|
+
function debugString(val) {
|
|
155719
|
+
const type = typeof val;
|
|
155720
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
155721
|
+
return `${val}`;
|
|
155722
|
+
}
|
|
155723
|
+
if (type == "string") {
|
|
155724
|
+
return `"${val}"`;
|
|
155725
|
+
}
|
|
155726
|
+
if (type == "symbol") {
|
|
155727
|
+
const description = val.description;
|
|
155728
|
+
if (description == null) {
|
|
155729
|
+
return "Symbol";
|
|
155730
|
+
} else {
|
|
155731
|
+
return `Symbol(${description})`;
|
|
155732
|
+
}
|
|
155733
|
+
}
|
|
155734
|
+
if (type == "function") {
|
|
155735
|
+
const name5 = val.name;
|
|
155736
|
+
if (typeof name5 == "string" && name5.length > 0) {
|
|
155737
|
+
return `Function(${name5})`;
|
|
155738
|
+
} else {
|
|
155739
|
+
return "Function";
|
|
155740
|
+
}
|
|
155741
|
+
}
|
|
155742
|
+
if (Array.isArray(val)) {
|
|
155743
|
+
const length2 = val.length;
|
|
155744
|
+
let debug = "[";
|
|
155745
|
+
if (length2 > 0) {
|
|
155746
|
+
debug += debugString(val[0]);
|
|
155747
|
+
}
|
|
155748
|
+
for (let i = 1; i < length2; i++) {
|
|
155749
|
+
debug += ", " + debugString(val[i]);
|
|
155750
|
+
}
|
|
155751
|
+
debug += "]";
|
|
155752
|
+
return debug;
|
|
155753
|
+
}
|
|
155754
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
155755
|
+
let className;
|
|
155756
|
+
if (builtInMatches.length > 1) {
|
|
155757
|
+
className = builtInMatches[1];
|
|
155758
|
+
} else {
|
|
155759
|
+
return toString.call(val);
|
|
155760
|
+
}
|
|
155761
|
+
if (className == "Object") {
|
|
155762
|
+
try {
|
|
155763
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
155764
|
+
} catch (_) {
|
|
155765
|
+
return "Object";
|
|
155766
|
+
}
|
|
155767
|
+
}
|
|
155768
|
+
if (val instanceof Error) {
|
|
155769
|
+
return `${val.name}: ${val.message}
|
|
155770
|
+
${val.stack}`;
|
|
155771
|
+
}
|
|
155772
|
+
return className;
|
|
155773
|
+
}
|
|
155774
|
+
__name(debugString, "debugString");
|
|
155775
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
155776
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
155777
|
+
const real = /* @__PURE__ */ __name((...args) => {
|
|
155778
|
+
state.cnt++;
|
|
155779
|
+
const a = state.a;
|
|
155780
|
+
state.a = 0;
|
|
155781
|
+
try {
|
|
155782
|
+
return f(a, state.b, ...args);
|
|
155783
|
+
} finally {
|
|
155784
|
+
if (--state.cnt === 0) {
|
|
155785
|
+
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
155786
|
+
} else {
|
|
155787
|
+
state.a = a;
|
|
155788
|
+
}
|
|
155789
|
+
}
|
|
155790
|
+
}, "real");
|
|
155791
|
+
real.original = state;
|
|
155792
|
+
return real;
|
|
155793
|
+
}
|
|
155794
|
+
__name(makeMutClosure, "makeMutClosure");
|
|
155795
|
+
function __wbg_adapter_24(arg0, arg1, arg2) {
|
|
155796
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(arg0, arg1, addHeapObject(arg2));
|
|
155797
|
+
}
|
|
155798
|
+
__name(__wbg_adapter_24, "__wbg_adapter_24");
|
|
155799
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
155800
|
+
const ptr = malloc(arg.length * 1);
|
|
155801
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
155802
|
+
WASM_VECTOR_LEN = arg.length;
|
|
155803
|
+
return ptr;
|
|
155804
|
+
}
|
|
155805
|
+
__name(passArray8ToWasm0, "passArray8ToWasm0");
|
|
155806
|
+
function generateEd25519KeyFromBytes(bytes) {
|
|
155807
|
+
try {
|
|
155808
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
155809
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
155810
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155811
|
+
wasm.generateEd25519KeyFromBytes(retptr, ptr0, len0);
|
|
155812
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
155813
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
155814
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
155815
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155816
|
+
var ptr1 = r0;
|
|
155817
|
+
var len1 = r1;
|
|
155818
|
+
if (r3) {
|
|
155819
|
+
ptr1 = 0;
|
|
155820
|
+
len1 = 0;
|
|
155821
|
+
throw takeObject(r2);
|
|
155822
|
+
}
|
|
155823
|
+
return getStringFromWasm0(ptr1, len1);
|
|
155824
|
+
} finally {
|
|
155825
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
155826
|
+
wasm.__wbindgen_free(ptr1, len1);
|
|
155827
|
+
}
|
|
155828
|
+
}
|
|
155829
|
+
__name(generateEd25519KeyFromBytes, "generateEd25519KeyFromBytes");
|
|
155830
|
+
function generateSecp256k1KeyFromBytes(bytes) {
|
|
155831
|
+
try {
|
|
155832
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
155833
|
+
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
155834
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155835
|
+
wasm.generateSecp256k1KeyFromBytes(retptr, ptr0, len0);
|
|
155836
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
155837
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
155838
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
155839
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155840
|
+
var ptr1 = r0;
|
|
155841
|
+
var len1 = r1;
|
|
155842
|
+
if (r3) {
|
|
155843
|
+
ptr1 = 0;
|
|
155844
|
+
len1 = 0;
|
|
155845
|
+
throw takeObject(r2);
|
|
155846
|
+
}
|
|
155847
|
+
return getStringFromWasm0(ptr1, len1);
|
|
155848
|
+
} finally {
|
|
155849
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
155850
|
+
wasm.__wbindgen_free(ptr1, len1);
|
|
155851
|
+
}
|
|
155852
|
+
}
|
|
155853
|
+
__name(generateSecp256k1KeyFromBytes, "generateSecp256k1KeyFromBytes");
|
|
155854
|
+
function keyToDID(method_pattern, jwk) {
|
|
155855
|
+
try {
|
|
155856
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
155857
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155858
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155859
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155860
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155861
|
+
wasm.keyToDID(retptr, ptr0, len0, ptr1, len1);
|
|
155862
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
155863
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
155864
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
155865
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
155866
|
+
var ptr2 = r0;
|
|
155867
|
+
var len2 = r1;
|
|
155868
|
+
if (r3) {
|
|
155869
|
+
ptr2 = 0;
|
|
155870
|
+
len2 = 0;
|
|
155871
|
+
throw takeObject(r2);
|
|
155872
|
+
}
|
|
155873
|
+
return getStringFromWasm0(ptr2, len2);
|
|
155874
|
+
} finally {
|
|
155875
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
155876
|
+
wasm.__wbindgen_free(ptr2, len2);
|
|
155877
|
+
}
|
|
155878
|
+
}
|
|
155879
|
+
__name(keyToDID, "keyToDID");
|
|
155880
|
+
function keyToVerificationMethod(method_pattern, jwk) {
|
|
155881
|
+
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155882
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155883
|
+
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155884
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155885
|
+
const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
|
|
155886
|
+
return takeObject(ret);
|
|
155887
|
+
}
|
|
155888
|
+
__name(keyToVerificationMethod, "keyToVerificationMethod");
|
|
155889
|
+
function issueCredential(credential, proof_options, key2) {
|
|
155890
|
+
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155891
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155892
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155893
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155894
|
+
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155895
|
+
const len2 = WASM_VECTOR_LEN;
|
|
155896
|
+
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
155897
|
+
return takeObject(ret);
|
|
155898
|
+
}
|
|
155899
|
+
__name(issueCredential, "issueCredential");
|
|
155900
|
+
function verifyCredential(vc, proof_options) {
|
|
155901
|
+
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155902
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155903
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155904
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155905
|
+
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1);
|
|
155906
|
+
return takeObject(ret);
|
|
155907
|
+
}
|
|
155908
|
+
__name(verifyCredential, "verifyCredential");
|
|
155909
|
+
function issuePresentation(presentation, proof_options, key2) {
|
|
155910
|
+
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155911
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155912
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155913
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155914
|
+
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155915
|
+
const len2 = WASM_VECTOR_LEN;
|
|
155916
|
+
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
155917
|
+
return takeObject(ret);
|
|
155918
|
+
}
|
|
155919
|
+
__name(issuePresentation, "issuePresentation");
|
|
155920
|
+
function verifyPresentation(vp, proof_options) {
|
|
155921
|
+
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155922
|
+
const len0 = WASM_VECTOR_LEN;
|
|
155923
|
+
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155924
|
+
const len1 = WASM_VECTOR_LEN;
|
|
155925
|
+
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1);
|
|
155926
|
+
return takeObject(ret);
|
|
155927
|
+
}
|
|
155928
|
+
__name(verifyPresentation, "verifyPresentation");
|
|
155929
|
+
function handleError(f, args) {
|
|
155930
|
+
try {
|
|
155931
|
+
return f.apply(this, args);
|
|
155932
|
+
} catch (e) {
|
|
155933
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
155934
|
+
}
|
|
155935
|
+
}
|
|
155936
|
+
__name(handleError, "handleError");
|
|
155937
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
155938
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
155939
|
+
}
|
|
155940
|
+
__name(getArrayU8FromWasm0, "getArrayU8FromWasm0");
|
|
155941
|
+
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
155942
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
155943
|
+
}
|
|
155944
|
+
__name(__wbg_adapter_110, "__wbg_adapter_110");
|
|
155945
|
+
function load(module, imports) {
|
|
155946
|
+
return __async$1(this, null, function* () {
|
|
155947
|
+
if (typeof Response === "function" && module instanceof Response) {
|
|
155948
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
155949
|
+
try {
|
|
155950
|
+
return yield WebAssembly.instantiateStreaming(module, imports);
|
|
155951
|
+
} catch (e) {
|
|
155952
|
+
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
155953
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
155954
|
+
} else {
|
|
155955
|
+
throw e;
|
|
155956
|
+
}
|
|
155957
|
+
}
|
|
155958
|
+
}
|
|
155959
|
+
const bytes = yield module.arrayBuffer();
|
|
155960
|
+
return yield WebAssembly.instantiate(bytes, imports);
|
|
155961
|
+
} else {
|
|
155962
|
+
const instance = yield WebAssembly.instantiate(module, imports);
|
|
155963
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
155964
|
+
return { instance, module };
|
|
155965
|
+
} else {
|
|
155966
|
+
return instance;
|
|
155967
|
+
}
|
|
155968
|
+
}
|
|
155969
|
+
});
|
|
155970
|
+
}
|
|
155971
|
+
__name(load, "load");
|
|
155972
|
+
function init2(input) {
|
|
155973
|
+
return __async$1(this, null, function* () {
|
|
155974
|
+
const imports = {};
|
|
155975
|
+
imports.wbg = {};
|
|
155976
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
155977
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
155978
|
+
return addHeapObject(ret);
|
|
155979
|
+
};
|
|
155980
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
155981
|
+
takeObject(arg0);
|
|
155982
|
+
};
|
|
155983
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
155984
|
+
const obj = takeObject(arg0).original;
|
|
155985
|
+
if (obj.cnt-- == 1) {
|
|
155986
|
+
obj.a = 0;
|
|
155987
|
+
return true;
|
|
155988
|
+
}
|
|
155989
|
+
const ret = false;
|
|
155990
|
+
return ret;
|
|
155991
|
+
};
|
|
155992
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
155993
|
+
const ret = getObject(arg0);
|
|
155994
|
+
return addHeapObject(ret);
|
|
155995
|
+
};
|
|
155996
|
+
imports.wbg.__wbg_fetch_811d43d6bdcad5b1 = function(arg0) {
|
|
155997
|
+
const ret = fetch(getObject(arg0));
|
|
155998
|
+
return addHeapObject(ret);
|
|
155999
|
+
};
|
|
156000
|
+
imports.wbg.__wbg_fetch_bf56e2a9f0644e3f = function(arg0, arg1) {
|
|
156001
|
+
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
156002
|
+
return addHeapObject(ret);
|
|
156003
|
+
};
|
|
156004
|
+
imports.wbg.__wbg_new_89d7f088c1c45353 = function() {
|
|
156005
|
+
return handleError(function() {
|
|
156006
|
+
const ret = new Headers();
|
|
156007
|
+
return addHeapObject(ret);
|
|
156008
|
+
}, arguments);
|
|
156009
|
+
};
|
|
156010
|
+
imports.wbg.__wbg_append_f4f93bc73c45ee3e = function() {
|
|
156011
|
+
return handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
|
156012
|
+
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
156013
|
+
}, arguments);
|
|
156014
|
+
};
|
|
156015
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
156016
|
+
const obj = getObject(arg1);
|
|
156017
|
+
const ret = typeof obj === "string" ? obj : void 0;
|
|
156018
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156019
|
+
var len0 = WASM_VECTOR_LEN;
|
|
156020
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
156021
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
156022
|
+
};
|
|
156023
|
+
imports.wbg.__wbg_instanceof_Response_ccfeb62399355bcd = function(arg0) {
|
|
156024
|
+
const ret = getObject(arg0) instanceof Response;
|
|
156025
|
+
return ret;
|
|
156026
|
+
};
|
|
156027
|
+
imports.wbg.__wbg_url_06c0f822d68d195c = function(arg0, arg1) {
|
|
156028
|
+
const ret = getObject(arg1).url;
|
|
156029
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156030
|
+
const len0 = WASM_VECTOR_LEN;
|
|
156031
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
156032
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
156033
|
+
};
|
|
156034
|
+
imports.wbg.__wbg_status_600fd8b881393898 = function(arg0) {
|
|
156035
|
+
const ret = getObject(arg0).status;
|
|
156036
|
+
return ret;
|
|
156037
|
+
};
|
|
156038
|
+
imports.wbg.__wbg_headers_9e7f2c05a9b962ea = function(arg0) {
|
|
156039
|
+
const ret = getObject(arg0).headers;
|
|
156040
|
+
return addHeapObject(ret);
|
|
156041
|
+
};
|
|
156042
|
+
imports.wbg.__wbg_arrayBuffer_5a99283a3954c850 = function() {
|
|
156043
|
+
return handleError(function(arg0) {
|
|
156044
|
+
const ret = getObject(arg0).arrayBuffer();
|
|
156045
|
+
return addHeapObject(ret);
|
|
156046
|
+
}, arguments);
|
|
156047
|
+
};
|
|
156048
|
+
imports.wbg.__wbg_newwithstrandinit_fd99688f189f053e = function() {
|
|
156049
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
156050
|
+
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
156051
|
+
return addHeapObject(ret);
|
|
156052
|
+
}, arguments);
|
|
156053
|
+
};
|
|
156054
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
156055
|
+
const val = getObject(arg0);
|
|
156056
|
+
const ret = typeof val === "object" && val !== null;
|
|
156057
|
+
return ret;
|
|
156058
|
+
};
|
|
156059
|
+
imports.wbg.__wbg_self_86b4b13392c7af56 = function() {
|
|
156060
|
+
return handleError(function() {
|
|
156061
|
+
const ret = self.self;
|
|
156062
|
+
return addHeapObject(ret);
|
|
156063
|
+
}, arguments);
|
|
156064
|
+
};
|
|
156065
|
+
imports.wbg.__wbg_crypto_b8c92eaac23d0d80 = function(arg0) {
|
|
156066
|
+
const ret = getObject(arg0).crypto;
|
|
156067
|
+
return addHeapObject(ret);
|
|
156068
|
+
};
|
|
156069
|
+
imports.wbg.__wbg_msCrypto_9ad6677321a08dd8 = function(arg0) {
|
|
156070
|
+
const ret = getObject(arg0).msCrypto;
|
|
156071
|
+
return addHeapObject(ret);
|
|
156072
|
+
};
|
|
156073
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
156074
|
+
const ret = getObject(arg0) === void 0;
|
|
156075
|
+
return ret;
|
|
156076
|
+
};
|
|
156077
|
+
imports.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81 = function() {
|
|
156078
|
+
const ret = module;
|
|
156079
|
+
return addHeapObject(ret);
|
|
156080
|
+
};
|
|
156081
|
+
imports.wbg.__wbg_require_f5521a5b85ad2542 = function(arg0, arg1, arg2) {
|
|
156082
|
+
const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
|
|
156083
|
+
return addHeapObject(ret);
|
|
156084
|
+
};
|
|
156085
|
+
imports.wbg.__wbg_getRandomValues_dd27e6b0652b3236 = function(arg0) {
|
|
156086
|
+
const ret = getObject(arg0).getRandomValues;
|
|
156087
|
+
return addHeapObject(ret);
|
|
156088
|
+
};
|
|
156089
|
+
imports.wbg.__wbg_getRandomValues_e57c9b75ddead065 = function(arg0, arg1) {
|
|
156090
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
156091
|
+
};
|
|
156092
|
+
imports.wbg.__wbg_randomFillSync_d2ba53160aec6aba = function(arg0, arg1, arg2) {
|
|
156093
|
+
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
156094
|
+
};
|
|
156095
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
156096
|
+
const ret = typeof getObject(arg0) === "function";
|
|
156097
|
+
return ret;
|
|
156098
|
+
};
|
|
156099
|
+
imports.wbg.__wbg_newnoargs_e23b458e372830de = function(arg0, arg1) {
|
|
156100
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
156101
|
+
return addHeapObject(ret);
|
|
156102
|
+
};
|
|
156103
|
+
imports.wbg.__wbg_next_cabb70b365520721 = function(arg0) {
|
|
156104
|
+
const ret = getObject(arg0).next;
|
|
156105
|
+
return addHeapObject(ret);
|
|
156106
|
+
};
|
|
156107
|
+
imports.wbg.__wbg_next_bf3d83fc18df496e = function() {
|
|
156108
|
+
return handleError(function(arg0) {
|
|
156109
|
+
const ret = getObject(arg0).next();
|
|
156110
|
+
return addHeapObject(ret);
|
|
156111
|
+
}, arguments);
|
|
156112
|
+
};
|
|
156113
|
+
imports.wbg.__wbg_done_040f966faa9a72b3 = function(arg0) {
|
|
156114
|
+
const ret = getObject(arg0).done;
|
|
156115
|
+
return ret;
|
|
156116
|
+
};
|
|
156117
|
+
imports.wbg.__wbg_value_419afbd9b9574c4c = function(arg0) {
|
|
156118
|
+
const ret = getObject(arg0).value;
|
|
156119
|
+
return addHeapObject(ret);
|
|
156120
|
+
};
|
|
156121
|
+
imports.wbg.__wbg_iterator_4832ef1f15b0382b = function() {
|
|
156122
|
+
const ret = Symbol.iterator;
|
|
156123
|
+
return addHeapObject(ret);
|
|
156124
|
+
};
|
|
156125
|
+
imports.wbg.__wbg_get_a9cab131e3152c49 = function() {
|
|
156126
|
+
return handleError(function(arg0, arg1) {
|
|
156127
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
156128
|
+
return addHeapObject(ret);
|
|
156129
|
+
}, arguments);
|
|
156130
|
+
};
|
|
156131
|
+
imports.wbg.__wbg_call_ae78342adc33730a = function() {
|
|
156132
|
+
return handleError(function(arg0, arg1) {
|
|
156133
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
156134
|
+
return addHeapObject(ret);
|
|
156135
|
+
}, arguments);
|
|
156136
|
+
};
|
|
156137
|
+
imports.wbg.__wbg_new_36359baae5a47e27 = function() {
|
|
156138
|
+
const ret = new Object();
|
|
156139
|
+
return addHeapObject(ret);
|
|
156140
|
+
};
|
|
156141
|
+
imports.wbg.__wbg_call_3ed288a247f13ea5 = function() {
|
|
156142
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
156143
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
156144
|
+
return addHeapObject(ret);
|
|
156145
|
+
}, arguments);
|
|
156146
|
+
};
|
|
156147
|
+
imports.wbg.__wbg_getTime_bffb1c09df09618b = function(arg0) {
|
|
156148
|
+
const ret = getObject(arg0).getTime();
|
|
156149
|
+
return ret;
|
|
156150
|
+
};
|
|
156151
|
+
imports.wbg.__wbg_new0_0ff7eb5c1486f3ec = function() {
|
|
156152
|
+
const ret = new Date();
|
|
156153
|
+
return addHeapObject(ret);
|
|
156154
|
+
};
|
|
156155
|
+
imports.wbg.__wbg_new_37705eed627d5ed9 = function(arg0, arg1) {
|
|
156156
|
+
try {
|
|
156157
|
+
var state0 = { a: arg0, b: arg1 };
|
|
156158
|
+
var cb0 = /* @__PURE__ */ __name((arg02, arg12) => {
|
|
156159
|
+
const a = state0.a;
|
|
156160
|
+
state0.a = 0;
|
|
156161
|
+
try {
|
|
156162
|
+
return __wbg_adapter_110(a, state0.b, arg02, arg12);
|
|
156163
|
+
} finally {
|
|
156164
|
+
state0.a = a;
|
|
156165
|
+
}
|
|
156166
|
+
}, "cb0");
|
|
156167
|
+
const ret = new Promise(cb0);
|
|
156168
|
+
return addHeapObject(ret);
|
|
156169
|
+
} finally {
|
|
156170
|
+
state0.a = state0.b = 0;
|
|
156171
|
+
}
|
|
156172
|
+
};
|
|
156173
|
+
imports.wbg.__wbg_resolve_a9a87bdd64e9e62c = function(arg0) {
|
|
156174
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
156175
|
+
return addHeapObject(ret);
|
|
156176
|
+
};
|
|
156177
|
+
imports.wbg.__wbg_then_ce526c837d07b68f = function(arg0, arg1) {
|
|
156178
|
+
const ret = getObject(arg0).then(getObject(arg1));
|
|
156179
|
+
return addHeapObject(ret);
|
|
156180
|
+
};
|
|
156181
|
+
imports.wbg.__wbg_then_842e65b843962f56 = function(arg0, arg1, arg2) {
|
|
156182
|
+
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
156183
|
+
return addHeapObject(ret);
|
|
156184
|
+
};
|
|
156185
|
+
imports.wbg.__wbg_self_99737b4dcdf6f0d8 = function() {
|
|
156186
|
+
return handleError(function() {
|
|
156187
|
+
const ret = self.self;
|
|
156188
|
+
return addHeapObject(ret);
|
|
156189
|
+
}, arguments);
|
|
156190
|
+
};
|
|
156191
|
+
imports.wbg.__wbg_window_9b61fbbf3564c4fb = function() {
|
|
156192
|
+
return handleError(function() {
|
|
156193
|
+
const ret = window.window;
|
|
156194
|
+
return addHeapObject(ret);
|
|
156195
|
+
}, arguments);
|
|
156196
|
+
};
|
|
156197
|
+
imports.wbg.__wbg_globalThis_8e275ef40caea3a3 = function() {
|
|
156198
|
+
return handleError(function() {
|
|
156199
|
+
const ret = globalThis.globalThis;
|
|
156200
|
+
return addHeapObject(ret);
|
|
156201
|
+
}, arguments);
|
|
156202
|
+
};
|
|
156203
|
+
imports.wbg.__wbg_global_5de1e0f82bddcd27 = function() {
|
|
156204
|
+
return handleError(function() {
|
|
156205
|
+
const ret = global.global;
|
|
156206
|
+
return addHeapObject(ret);
|
|
156207
|
+
}, arguments);
|
|
156208
|
+
};
|
|
156209
|
+
imports.wbg.__wbg_buffer_7af23f65f6c64548 = function(arg0) {
|
|
156210
|
+
const ret = getObject(arg0).buffer;
|
|
156211
|
+
return addHeapObject(ret);
|
|
156212
|
+
};
|
|
156213
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974 = function(arg0, arg1, arg2) {
|
|
156214
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
156215
|
+
return addHeapObject(ret);
|
|
156216
|
+
};
|
|
156217
|
+
imports.wbg.__wbg_new_cc9018bd6f283b6f = function(arg0) {
|
|
156218
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
156219
|
+
return addHeapObject(ret);
|
|
156220
|
+
};
|
|
156221
|
+
imports.wbg.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {
|
|
156222
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
156223
|
+
};
|
|
156224
|
+
imports.wbg.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {
|
|
156225
|
+
const ret = getObject(arg0).length;
|
|
156226
|
+
return ret;
|
|
156227
|
+
};
|
|
156228
|
+
imports.wbg.__wbg_newwithlength_8f0657faca9f1422 = function(arg0) {
|
|
156229
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
156230
|
+
return addHeapObject(ret);
|
|
156231
|
+
};
|
|
156232
|
+
imports.wbg.__wbg_subarray_da527dbd24eafb6b = function(arg0, arg1, arg2) {
|
|
156233
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
156234
|
+
return addHeapObject(ret);
|
|
156235
|
+
};
|
|
156236
|
+
imports.wbg.__wbg_has_ce995ec88636803d = function() {
|
|
156237
|
+
return handleError(function(arg0, arg1) {
|
|
156238
|
+
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
156239
|
+
return ret;
|
|
156240
|
+
}, arguments);
|
|
156241
|
+
};
|
|
156242
|
+
imports.wbg.__wbg_set_93b1c87ee2af852e = function() {
|
|
156243
|
+
return handleError(function(arg0, arg1, arg2) {
|
|
156244
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
156245
|
+
return ret;
|
|
156246
|
+
}, arguments);
|
|
156247
|
+
};
|
|
156248
|
+
imports.wbg.__wbg_stringify_c760003feffcc1f2 = function() {
|
|
156249
|
+
return handleError(function(arg0) {
|
|
156250
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
156251
|
+
return addHeapObject(ret);
|
|
156252
|
+
}, arguments);
|
|
156253
|
+
};
|
|
156254
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
156255
|
+
const ret = debugString(getObject(arg1));
|
|
156256
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156257
|
+
const len0 = WASM_VECTOR_LEN;
|
|
156258
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
156259
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
156260
|
+
};
|
|
156261
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
156262
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
156263
|
+
};
|
|
156264
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
156265
|
+
const ret = wasm.memory;
|
|
156266
|
+
return addHeapObject(ret);
|
|
156267
|
+
};
|
|
156268
|
+
imports.wbg.__wbindgen_closure_wrapper10913 = function(arg0, arg1, arg2) {
|
|
156269
|
+
const ret = makeMutClosure(arg0, arg1, 3725, __wbg_adapter_24);
|
|
156270
|
+
return addHeapObject(ret);
|
|
156271
|
+
};
|
|
156272
|
+
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
156273
|
+
input = fetch(input);
|
|
156274
|
+
}
|
|
156275
|
+
const { instance, module } = yield load(yield input, imports);
|
|
156276
|
+
wasm = instance.exports;
|
|
156277
|
+
init2.__wbindgen_wasm_module = module;
|
|
156278
|
+
return wasm;
|
|
156279
|
+
});
|
|
156280
|
+
}
|
|
156281
|
+
__name(init2, "init");
|
|
156282
|
+
var didkit_wasm_default = init2;
|
|
156283
|
+
var initialized = false;
|
|
156284
|
+
var init3 = /* @__PURE__ */ __name((arg = "https://cdn.filestackcontent.com/dlXanMvQCGDR76JXcBkA") => __async$1(void 0, null, function* () {
|
|
156285
|
+
if (initialized)
|
|
156286
|
+
return;
|
|
156287
|
+
initialized = true;
|
|
156288
|
+
return didkit_wasm_default(arg);
|
|
156289
|
+
}), "init");
|
|
156290
|
+
var didkit_default = init3;
|
|
156291
|
+
var getDidKitPlugin = /* @__PURE__ */ __name((input) => __async$1(void 0, null, function* () {
|
|
156292
|
+
yield didkit_default(input);
|
|
155976
156293
|
const memoizedDids = {};
|
|
155977
|
-
const keyPairs = {
|
|
155978
|
-
ed25519: wallet.pluginMethods.generateEd25519KeyFromBytes(seedBytes),
|
|
155979
|
-
secp256k1: wallet.pluginMethods.generateSecp256k1KeyFromBytes(seedBytes)
|
|
155980
|
-
};
|
|
155981
156294
|
return {
|
|
155982
156295
|
pluginMethods: {
|
|
155983
|
-
|
|
155984
|
-
|
|
155985
|
-
|
|
155986
|
-
|
|
156296
|
+
generateEd25519KeyFromBytes: (_wallet, bytes) => JSON.parse(generateEd25519KeyFromBytes(bytes)),
|
|
156297
|
+
generateSecp256k1KeyFromBytes: (_wallet, bytes) => JSON.parse(generateSecp256k1KeyFromBytes(bytes)),
|
|
156298
|
+
keyToDid: (_wallet, type, keypair) => {
|
|
156299
|
+
const memoizedDid = memoizedDids[type];
|
|
156300
|
+
if (!memoizedDid) {
|
|
156301
|
+
const did = keyToDID(type, JSON.stringify(keypair));
|
|
156302
|
+
memoizedDids[type] = did;
|
|
156303
|
+
return did;
|
|
155987
156304
|
}
|
|
155988
|
-
return
|
|
155989
|
-
},
|
|
155990
|
-
getSubjectKeypair: (_wallet, type = "ed25519") => {
|
|
155991
|
-
if (!keyPairs[type])
|
|
155992
|
-
throw new Error("Unsupported algorithm");
|
|
155993
|
-
return keyPairs[type];
|
|
156305
|
+
return memoizedDid;
|
|
155994
156306
|
},
|
|
155995
|
-
|
|
156307
|
+
keyToVerificationMethod: (_wallet, type, keypair) => __async$1(void 0, null, function* () {
|
|
156308
|
+
return keyToVerificationMethod(type, JSON.stringify(keypair));
|
|
156309
|
+
}),
|
|
156310
|
+
issueCredential: (_wallet, credential, options, keypair) => __async$1(void 0, null, function* () {
|
|
156311
|
+
return JSON.parse(yield issueCredential(JSON.stringify(credential), JSON.stringify(options), JSON.stringify(keypair)));
|
|
156312
|
+
}),
|
|
156313
|
+
verifyCredential: (_wallet, credential) => __async$1(void 0, null, function* () {
|
|
156314
|
+
return JSON.parse(yield verifyCredential(JSON.stringify(credential), "{}"));
|
|
156315
|
+
}),
|
|
156316
|
+
issuePresentation: (_wallet, presentation, options, keypair) => __async$1(void 0, null, function* () {
|
|
156317
|
+
return JSON.parse(yield issuePresentation(JSON.stringify(presentation), JSON.stringify(options), JSON.stringify(keypair)));
|
|
156318
|
+
}),
|
|
156319
|
+
verifyPresentation: (_wallet, presentation) => __async$1(void 0, null, function* () {
|
|
156320
|
+
return JSON.parse(yield verifyPresentation(JSON.stringify(presentation), "{}"));
|
|
156321
|
+
})
|
|
155996
156322
|
}
|
|
155997
156323
|
};
|
|
155998
|
-
}), "
|
|
156324
|
+
}), "getDidKitPlugin");
|
|
155999
156325
|
var ExpirationPlugin = /* @__PURE__ */ __name((wallet) => ({
|
|
156000
156326
|
pluginMethods: {
|
|
156001
156327
|
verifyCredential: (_wallet, credential) => __async$1(void 0, null, function* () {
|
|
@@ -156009,113 +156335,6 @@ var ExpirationPlugin = /* @__PURE__ */ __name((wallet) => ({
|
|
|
156009
156335
|
})
|
|
156010
156336
|
}
|
|
156011
156337
|
}), "ExpirationPlugin");
|
|
156012
|
-
var recycleDependents = /* @__PURE__ */ __name((_methods) => ({}), "recycleDependents");
|
|
156013
|
-
var issueCredential = /* @__PURE__ */ __name((initWallet) => {
|
|
156014
|
-
return (wallet, credential) => __async$1(void 0, null, function* () {
|
|
156015
|
-
const kp = wallet.pluginMethods.getSubjectKeypair();
|
|
156016
|
-
if (!kp)
|
|
156017
|
-
throw new Error("Cannot issue credential: Could not get subject keypair");
|
|
156018
|
-
const options = {
|
|
156019
|
-
verificationMethod: yield initWallet.pluginMethods.keyToVerificationMethod("key", kp),
|
|
156020
|
-
proofPurpose: "assertionMethod"
|
|
156021
|
-
};
|
|
156022
|
-
return initWallet.pluginMethods.issueCredential(credential, options, kp);
|
|
156023
|
-
});
|
|
156024
|
-
}, "issueCredential");
|
|
156025
|
-
var verifyCredential = /* @__PURE__ */ __name((initWallet) => {
|
|
156026
|
-
return (_wallet, credential) => __async$1(void 0, null, function* () {
|
|
156027
|
-
return initWallet.pluginMethods.verifyCredential(credential);
|
|
156028
|
-
});
|
|
156029
|
-
}, "verifyCredential");
|
|
156030
|
-
var issuePresentation = /* @__PURE__ */ __name((initWallet) => {
|
|
156031
|
-
return (wallet, presentation) => __async$1(void 0, null, function* () {
|
|
156032
|
-
const kp = wallet.pluginMethods.getSubjectKeypair();
|
|
156033
|
-
if (!kp)
|
|
156034
|
-
throw new Error("Cannot issue credential: Could not get subject keypair");
|
|
156035
|
-
const options = {
|
|
156036
|
-
verificationMethod: yield initWallet.pluginMethods.keyToVerificationMethod("key", kp),
|
|
156037
|
-
proofPurpose: "assertionMethod"
|
|
156038
|
-
};
|
|
156039
|
-
return initWallet.pluginMethods.issuePresentation(presentation, options, kp);
|
|
156040
|
-
});
|
|
156041
|
-
}, "issuePresentation");
|
|
156042
|
-
var verifyPresentation = /* @__PURE__ */ __name((initWallet) => {
|
|
156043
|
-
return (_wallet, presentation) => __async$1(void 0, null, function* () {
|
|
156044
|
-
return initWallet.pluginMethods.verifyPresentation(presentation);
|
|
156045
|
-
});
|
|
156046
|
-
}, "verifyPresentation");
|
|
156047
|
-
var getVCPlugin = /* @__PURE__ */ __name((wallet) => __async$1(void 0, null, function* () {
|
|
156048
|
-
return {
|
|
156049
|
-
pluginMethods: __spreadProps(__spreadValues({}, recycleDependents(wallet.pluginMethods)), {
|
|
156050
|
-
issueCredential: issueCredential(wallet),
|
|
156051
|
-
verifyCredential: verifyCredential(wallet),
|
|
156052
|
-
issuePresentation: issuePresentation(wallet),
|
|
156053
|
-
verifyPresentation: verifyPresentation(wallet),
|
|
156054
|
-
getTestVc: (_wallet, subject = "did:example:d23dd687a7dc6787646f2eb98d0") => {
|
|
156055
|
-
const did = _wallet.pluginMethods.getSubjectDid("key");
|
|
156056
|
-
return {
|
|
156057
|
-
"@context": ["https://www.w3.org/2018/credentials/v1"],
|
|
156058
|
-
id: "http://example.org/credentials/3731",
|
|
156059
|
-
type: ["VerifiableCredential"],
|
|
156060
|
-
issuer: did,
|
|
156061
|
-
issuanceDate: "2020-08-19T21:41:50Z",
|
|
156062
|
-
credentialSubject: { id: subject }
|
|
156063
|
-
};
|
|
156064
|
-
},
|
|
156065
|
-
getTestVp: (_wallet, _credential) => __async$1(void 0, null, function* () {
|
|
156066
|
-
const credential = _credential || (yield _wallet.pluginMethods.issueCredential(_wallet.pluginMethods.getTestVc()));
|
|
156067
|
-
const did = _wallet.pluginMethods.getSubjectDid("key");
|
|
156068
|
-
return {
|
|
156069
|
-
"@context": ["https://www.w3.org/2018/credentials/v1"],
|
|
156070
|
-
type: ["VerifiablePresentation"],
|
|
156071
|
-
holder: did,
|
|
156072
|
-
verifiableCredential: credential
|
|
156073
|
-
};
|
|
156074
|
-
})
|
|
156075
|
-
})
|
|
156076
|
-
};
|
|
156077
|
-
}), "getVCPlugin");
|
|
156078
|
-
var getEthereumPlugin = /* @__PURE__ */ __name((initWallet, config2) => {
|
|
156079
|
-
const { address, infuraProjectId, network = "mainnet" } = config2;
|
|
156080
|
-
let provider;
|
|
156081
|
-
if (infuraProjectId) {
|
|
156082
|
-
provider = new InfuraProvider(network, infuraProjectId);
|
|
156083
|
-
} else {
|
|
156084
|
-
provider = getDefaultProvider(network);
|
|
156085
|
-
}
|
|
156086
|
-
const checkErc20TokenBalance = /* @__PURE__ */ __name((tokenContractAddress) => __async$1(void 0, null, function* () {
|
|
156087
|
-
if (!address) {
|
|
156088
|
-
throw new Error("Can't check balance: No address provided.");
|
|
156089
|
-
}
|
|
156090
|
-
const erc20Abi = require_erc20_abi();
|
|
156091
|
-
const contract = new Contract(tokenContractAddress, erc20Abi, provider);
|
|
156092
|
-
const balance = yield contract.balanceOf(address);
|
|
156093
|
-
const formattedBalance = formatUnits(balance);
|
|
156094
|
-
return formattedBalance;
|
|
156095
|
-
}), "checkErc20TokenBalance");
|
|
156096
|
-
return {
|
|
156097
|
-
pluginMethods: {
|
|
156098
|
-
checkMyEth: () => __async$1(void 0, null, function* () {
|
|
156099
|
-
if (!address) {
|
|
156100
|
-
throw new Error("Can't check ETH: No ethereum address provided.");
|
|
156101
|
-
}
|
|
156102
|
-
const balance = yield provider.getBalance(address);
|
|
156103
|
-
const formattedBalance = formatEther(balance);
|
|
156104
|
-
return formattedBalance;
|
|
156105
|
-
}),
|
|
156106
|
-
checkMyDai: () => __async$1(void 0, null, function* () {
|
|
156107
|
-
const daiAddress = "0x6B175474E89094C44Da98b954EedeAC495271d0F";
|
|
156108
|
-
const daiBalance = yield checkErc20TokenBalance(daiAddress);
|
|
156109
|
-
return daiBalance;
|
|
156110
|
-
}),
|
|
156111
|
-
checkMyUsdc: () => __async$1(void 0, null, function* () {
|
|
156112
|
-
const usdcAddress = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";
|
|
156113
|
-
const usdcBalance = yield checkErc20TokenBalance(usdcAddress);
|
|
156114
|
-
return usdcBalance;
|
|
156115
|
-
})
|
|
156116
|
-
}
|
|
156117
|
-
};
|
|
156118
|
-
}, "getEthereumPlugin");
|
|
156119
156338
|
var util;
|
|
156120
156339
|
(function(util2) {
|
|
156121
156340
|
function assertNever(_x) {
|
|
@@ -160674,7 +160893,7 @@ var transformCheckMessage = /* @__PURE__ */ __name((check, credential) => {
|
|
|
160674
160893
|
expiration: credential.expirationDate ? `Valid \u2022 Expires ${format(new Date(credential.expirationDate), "dd MMM yyyy").toUpperCase()}` : "Valid \u2022 Does Not Expire"
|
|
160675
160894
|
}[check] || check;
|
|
160676
160895
|
}, "transformCheckMessage");
|
|
160677
|
-
var
|
|
160896
|
+
var verifyCredential3 = /* @__PURE__ */ __name((wallet) => {
|
|
160678
160897
|
return (credential) => __async$1(void 0, null, function* () {
|
|
160679
160898
|
const rawVerificationCheck = yield wallet.pluginMethods.verifyCredential(credential);
|
|
160680
160899
|
const verificationItems = [];
|
|
@@ -160702,772 +160921,17 @@ var verifyCredential2 = /* @__PURE__ */ __name((wallet) => {
|
|
|
160702
160921
|
return verificationItems;
|
|
160703
160922
|
});
|
|
160704
160923
|
}, "verifyCredential");
|
|
160705
|
-
var
|
|
160706
|
-
|
|
160707
|
-
definitions: {
|
|
160708
|
-
MyVerifiableCredentials: "kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"
|
|
160709
|
-
},
|
|
160710
|
-
schemas: {
|
|
160711
|
-
AchievementVerifiableCredential: "ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",
|
|
160712
|
-
VerifiableCredentialsList: "ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"
|
|
160713
|
-
},
|
|
160714
|
-
tiles: {}
|
|
160715
|
-
},
|
|
160716
|
-
credentialAlias: "MyVerifiableCredentials",
|
|
160717
|
-
ceramicEndpoint: "https://ceramic-node.welibrary.io:7007",
|
|
160718
|
-
defaultContentFamily: "SuperSkills"
|
|
160719
|
-
};
|
|
160720
|
-
var defaultEthereumArgs = {
|
|
160721
|
-
address: "",
|
|
160722
|
-
infuraProjectId: "",
|
|
160723
|
-
network: "mainnet"
|
|
160724
|
-
};
|
|
160725
|
-
var wasm;
|
|
160726
|
-
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
160727
|
-
cachedTextDecoder.decode();
|
|
160728
|
-
var cachegetUint8Memory0 = null;
|
|
160729
|
-
function getUint8Memory0() {
|
|
160730
|
-
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
|
160731
|
-
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
160732
|
-
}
|
|
160733
|
-
return cachegetUint8Memory0;
|
|
160734
|
-
}
|
|
160735
|
-
__name(getUint8Memory0, "getUint8Memory0");
|
|
160736
|
-
function getStringFromWasm0(ptr, len) {
|
|
160737
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
160738
|
-
}
|
|
160739
|
-
__name(getStringFromWasm0, "getStringFromWasm0");
|
|
160740
|
-
var heap = new Array(32).fill(void 0);
|
|
160741
|
-
heap.push(void 0, null, true, false);
|
|
160742
|
-
var heap_next = heap.length;
|
|
160743
|
-
function addHeapObject(obj) {
|
|
160744
|
-
if (heap_next === heap.length)
|
|
160745
|
-
heap.push(heap.length + 1);
|
|
160746
|
-
const idx = heap_next;
|
|
160747
|
-
heap_next = heap[idx];
|
|
160748
|
-
heap[idx] = obj;
|
|
160749
|
-
return idx;
|
|
160750
|
-
}
|
|
160751
|
-
__name(addHeapObject, "addHeapObject");
|
|
160752
|
-
function getObject(idx) {
|
|
160753
|
-
return heap[idx];
|
|
160754
|
-
}
|
|
160755
|
-
__name(getObject, "getObject");
|
|
160756
|
-
function dropObject(idx) {
|
|
160757
|
-
if (idx < 36)
|
|
160758
|
-
return;
|
|
160759
|
-
heap[idx] = heap_next;
|
|
160760
|
-
heap_next = idx;
|
|
160761
|
-
}
|
|
160762
|
-
__name(dropObject, "dropObject");
|
|
160763
|
-
function takeObject(idx) {
|
|
160764
|
-
const ret = getObject(idx);
|
|
160765
|
-
dropObject(idx);
|
|
160766
|
-
return ret;
|
|
160767
|
-
}
|
|
160768
|
-
__name(takeObject, "takeObject");
|
|
160769
|
-
var WASM_VECTOR_LEN = 0;
|
|
160770
|
-
var cachedTextEncoder = new TextEncoder("utf-8");
|
|
160771
|
-
var encodeString2 = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
|
|
160772
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
160773
|
-
} : function(arg, view) {
|
|
160774
|
-
const buf2 = cachedTextEncoder.encode(arg);
|
|
160775
|
-
view.set(buf2);
|
|
160776
|
-
return {
|
|
160777
|
-
read: arg.length,
|
|
160778
|
-
written: buf2.length
|
|
160779
|
-
};
|
|
160780
|
-
};
|
|
160781
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
160782
|
-
if (realloc === void 0) {
|
|
160783
|
-
const buf2 = cachedTextEncoder.encode(arg);
|
|
160784
|
-
const ptr2 = malloc(buf2.length);
|
|
160785
|
-
getUint8Memory0().subarray(ptr2, ptr2 + buf2.length).set(buf2);
|
|
160786
|
-
WASM_VECTOR_LEN = buf2.length;
|
|
160787
|
-
return ptr2;
|
|
160788
|
-
}
|
|
160789
|
-
let len = arg.length;
|
|
160790
|
-
let ptr = malloc(len);
|
|
160791
|
-
const mem = getUint8Memory0();
|
|
160792
|
-
let offset = 0;
|
|
160793
|
-
for (; offset < len; offset++) {
|
|
160794
|
-
const code5 = arg.charCodeAt(offset);
|
|
160795
|
-
if (code5 > 127)
|
|
160796
|
-
break;
|
|
160797
|
-
mem[ptr + offset] = code5;
|
|
160798
|
-
}
|
|
160799
|
-
if (offset !== len) {
|
|
160800
|
-
if (offset !== 0) {
|
|
160801
|
-
arg = arg.slice(offset);
|
|
160802
|
-
}
|
|
160803
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
160804
|
-
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
160805
|
-
const ret = encodeString2(arg, view);
|
|
160806
|
-
offset += ret.written;
|
|
160807
|
-
}
|
|
160808
|
-
WASM_VECTOR_LEN = offset;
|
|
160809
|
-
return ptr;
|
|
160810
|
-
}
|
|
160811
|
-
__name(passStringToWasm0, "passStringToWasm0");
|
|
160812
|
-
function isLikeNone(x) {
|
|
160813
|
-
return x === void 0 || x === null;
|
|
160814
|
-
}
|
|
160815
|
-
__name(isLikeNone, "isLikeNone");
|
|
160816
|
-
var cachegetInt32Memory0 = null;
|
|
160817
|
-
function getInt32Memory0() {
|
|
160818
|
-
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
|
160819
|
-
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
160820
|
-
}
|
|
160821
|
-
return cachegetInt32Memory0;
|
|
160822
|
-
}
|
|
160823
|
-
__name(getInt32Memory0, "getInt32Memory0");
|
|
160824
|
-
function debugString(val) {
|
|
160825
|
-
const type = typeof val;
|
|
160826
|
-
if (type == "number" || type == "boolean" || val == null) {
|
|
160827
|
-
return `${val}`;
|
|
160828
|
-
}
|
|
160829
|
-
if (type == "string") {
|
|
160830
|
-
return `"${val}"`;
|
|
160831
|
-
}
|
|
160832
|
-
if (type == "symbol") {
|
|
160833
|
-
const description = val.description;
|
|
160834
|
-
if (description == null) {
|
|
160835
|
-
return "Symbol";
|
|
160836
|
-
} else {
|
|
160837
|
-
return `Symbol(${description})`;
|
|
160838
|
-
}
|
|
160839
|
-
}
|
|
160840
|
-
if (type == "function") {
|
|
160841
|
-
const name5 = val.name;
|
|
160842
|
-
if (typeof name5 == "string" && name5.length > 0) {
|
|
160843
|
-
return `Function(${name5})`;
|
|
160844
|
-
} else {
|
|
160845
|
-
return "Function";
|
|
160846
|
-
}
|
|
160847
|
-
}
|
|
160848
|
-
if (Array.isArray(val)) {
|
|
160849
|
-
const length2 = val.length;
|
|
160850
|
-
let debug = "[";
|
|
160851
|
-
if (length2 > 0) {
|
|
160852
|
-
debug += debugString(val[0]);
|
|
160853
|
-
}
|
|
160854
|
-
for (let i = 1; i < length2; i++) {
|
|
160855
|
-
debug += ", " + debugString(val[i]);
|
|
160856
|
-
}
|
|
160857
|
-
debug += "]";
|
|
160858
|
-
return debug;
|
|
160859
|
-
}
|
|
160860
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
160861
|
-
let className;
|
|
160862
|
-
if (builtInMatches.length > 1) {
|
|
160863
|
-
className = builtInMatches[1];
|
|
160864
|
-
} else {
|
|
160865
|
-
return toString.call(val);
|
|
160866
|
-
}
|
|
160867
|
-
if (className == "Object") {
|
|
160868
|
-
try {
|
|
160869
|
-
return "Object(" + JSON.stringify(val) + ")";
|
|
160870
|
-
} catch (_) {
|
|
160871
|
-
return "Object";
|
|
160872
|
-
}
|
|
160873
|
-
}
|
|
160874
|
-
if (val instanceof Error) {
|
|
160875
|
-
return `${val.name}: ${val.message}
|
|
160876
|
-
${val.stack}`;
|
|
160877
|
-
}
|
|
160878
|
-
return className;
|
|
160879
|
-
}
|
|
160880
|
-
__name(debugString, "debugString");
|
|
160881
|
-
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
160882
|
-
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
160883
|
-
const real = /* @__PURE__ */ __name((...args) => {
|
|
160884
|
-
state.cnt++;
|
|
160885
|
-
const a = state.a;
|
|
160886
|
-
state.a = 0;
|
|
160887
|
-
try {
|
|
160888
|
-
return f(a, state.b, ...args);
|
|
160889
|
-
} finally {
|
|
160890
|
-
if (--state.cnt === 0) {
|
|
160891
|
-
wasm.__wbindgen_export_2.get(state.dtor)(a, state.b);
|
|
160892
|
-
} else {
|
|
160893
|
-
state.a = a;
|
|
160894
|
-
}
|
|
160895
|
-
}
|
|
160896
|
-
}, "real");
|
|
160897
|
-
real.original = state;
|
|
160898
|
-
return real;
|
|
160899
|
-
}
|
|
160900
|
-
__name(makeMutClosure, "makeMutClosure");
|
|
160901
|
-
function __wbg_adapter_24(arg0, arg1, arg2) {
|
|
160902
|
-
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(arg0, arg1, addHeapObject(arg2));
|
|
160903
|
-
}
|
|
160904
|
-
__name(__wbg_adapter_24, "__wbg_adapter_24");
|
|
160905
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
160906
|
-
const ptr = malloc(arg.length * 1);
|
|
160907
|
-
getUint8Memory0().set(arg, ptr / 1);
|
|
160908
|
-
WASM_VECTOR_LEN = arg.length;
|
|
160909
|
-
return ptr;
|
|
160910
|
-
}
|
|
160911
|
-
__name(passArray8ToWasm0, "passArray8ToWasm0");
|
|
160912
|
-
function generateEd25519KeyFromBytes(bytes) {
|
|
160913
|
-
try {
|
|
160914
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
160915
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
160916
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160917
|
-
wasm.generateEd25519KeyFromBytes(retptr, ptr0, len0);
|
|
160918
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
160919
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
160920
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
160921
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
160922
|
-
var ptr1 = r0;
|
|
160923
|
-
var len1 = r1;
|
|
160924
|
-
if (r3) {
|
|
160925
|
-
ptr1 = 0;
|
|
160926
|
-
len1 = 0;
|
|
160927
|
-
throw takeObject(r2);
|
|
160928
|
-
}
|
|
160929
|
-
return getStringFromWasm0(ptr1, len1);
|
|
160930
|
-
} finally {
|
|
160931
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
160932
|
-
wasm.__wbindgen_free(ptr1, len1);
|
|
160933
|
-
}
|
|
160934
|
-
}
|
|
160935
|
-
__name(generateEd25519KeyFromBytes, "generateEd25519KeyFromBytes");
|
|
160936
|
-
function generateSecp256k1KeyFromBytes(bytes) {
|
|
160937
|
-
try {
|
|
160938
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
160939
|
-
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
160940
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160941
|
-
wasm.generateSecp256k1KeyFromBytes(retptr, ptr0, len0);
|
|
160942
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
160943
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
160944
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
160945
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
160946
|
-
var ptr1 = r0;
|
|
160947
|
-
var len1 = r1;
|
|
160948
|
-
if (r3) {
|
|
160949
|
-
ptr1 = 0;
|
|
160950
|
-
len1 = 0;
|
|
160951
|
-
throw takeObject(r2);
|
|
160952
|
-
}
|
|
160953
|
-
return getStringFromWasm0(ptr1, len1);
|
|
160954
|
-
} finally {
|
|
160955
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
160956
|
-
wasm.__wbindgen_free(ptr1, len1);
|
|
160957
|
-
}
|
|
160958
|
-
}
|
|
160959
|
-
__name(generateSecp256k1KeyFromBytes, "generateSecp256k1KeyFromBytes");
|
|
160960
|
-
function keyToDID(method_pattern, jwk) {
|
|
160961
|
-
try {
|
|
160962
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
160963
|
-
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160964
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160965
|
-
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160966
|
-
const len1 = WASM_VECTOR_LEN;
|
|
160967
|
-
wasm.keyToDID(retptr, ptr0, len0, ptr1, len1);
|
|
160968
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
160969
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
160970
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
160971
|
-
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
160972
|
-
var ptr2 = r0;
|
|
160973
|
-
var len2 = r1;
|
|
160974
|
-
if (r3) {
|
|
160975
|
-
ptr2 = 0;
|
|
160976
|
-
len2 = 0;
|
|
160977
|
-
throw takeObject(r2);
|
|
160978
|
-
}
|
|
160979
|
-
return getStringFromWasm0(ptr2, len2);
|
|
160980
|
-
} finally {
|
|
160981
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
160982
|
-
wasm.__wbindgen_free(ptr2, len2);
|
|
160983
|
-
}
|
|
160984
|
-
}
|
|
160985
|
-
__name(keyToDID, "keyToDID");
|
|
160986
|
-
function keyToVerificationMethod(method_pattern, jwk) {
|
|
160987
|
-
const ptr0 = passStringToWasm0(method_pattern, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160988
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160989
|
-
const ptr1 = passStringToWasm0(jwk, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160990
|
-
const len1 = WASM_VECTOR_LEN;
|
|
160991
|
-
const ret = wasm.keyToVerificationMethod(ptr0, len0, ptr1, len1);
|
|
160992
|
-
return takeObject(ret);
|
|
160993
|
-
}
|
|
160994
|
-
__name(keyToVerificationMethod, "keyToVerificationMethod");
|
|
160995
|
-
function issueCredential2(credential, proof_options, key2) {
|
|
160996
|
-
const ptr0 = passStringToWasm0(credential, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160997
|
-
const len0 = WASM_VECTOR_LEN;
|
|
160998
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
160999
|
-
const len1 = WASM_VECTOR_LEN;
|
|
161000
|
-
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161001
|
-
const len2 = WASM_VECTOR_LEN;
|
|
161002
|
-
const ret = wasm.issueCredential(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
161003
|
-
return takeObject(ret);
|
|
161004
|
-
}
|
|
161005
|
-
__name(issueCredential2, "issueCredential");
|
|
161006
|
-
function verifyCredential3(vc, proof_options) {
|
|
161007
|
-
const ptr0 = passStringToWasm0(vc, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161008
|
-
const len0 = WASM_VECTOR_LEN;
|
|
161009
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161010
|
-
const len1 = WASM_VECTOR_LEN;
|
|
161011
|
-
const ret = wasm.verifyCredential(ptr0, len0, ptr1, len1);
|
|
161012
|
-
return takeObject(ret);
|
|
161013
|
-
}
|
|
161014
|
-
__name(verifyCredential3, "verifyCredential");
|
|
161015
|
-
function issuePresentation2(presentation, proof_options, key2) {
|
|
161016
|
-
const ptr0 = passStringToWasm0(presentation, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161017
|
-
const len0 = WASM_VECTOR_LEN;
|
|
161018
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161019
|
-
const len1 = WASM_VECTOR_LEN;
|
|
161020
|
-
const ptr2 = passStringToWasm0(key2, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161021
|
-
const len2 = WASM_VECTOR_LEN;
|
|
161022
|
-
const ret = wasm.issuePresentation(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
161023
|
-
return takeObject(ret);
|
|
161024
|
-
}
|
|
161025
|
-
__name(issuePresentation2, "issuePresentation");
|
|
161026
|
-
function verifyPresentation2(vp, proof_options) {
|
|
161027
|
-
const ptr0 = passStringToWasm0(vp, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161028
|
-
const len0 = WASM_VECTOR_LEN;
|
|
161029
|
-
const ptr1 = passStringToWasm0(proof_options, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161030
|
-
const len1 = WASM_VECTOR_LEN;
|
|
161031
|
-
const ret = wasm.verifyPresentation(ptr0, len0, ptr1, len1);
|
|
161032
|
-
return takeObject(ret);
|
|
161033
|
-
}
|
|
161034
|
-
__name(verifyPresentation2, "verifyPresentation");
|
|
161035
|
-
function handleError(f, args) {
|
|
161036
|
-
try {
|
|
161037
|
-
return f.apply(this, args);
|
|
161038
|
-
} catch (e) {
|
|
161039
|
-
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
161040
|
-
}
|
|
161041
|
-
}
|
|
161042
|
-
__name(handleError, "handleError");
|
|
161043
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
161044
|
-
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
161045
|
-
}
|
|
161046
|
-
__name(getArrayU8FromWasm0, "getArrayU8FromWasm0");
|
|
161047
|
-
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
161048
|
-
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
161049
|
-
}
|
|
161050
|
-
__name(__wbg_adapter_110, "__wbg_adapter_110");
|
|
161051
|
-
function load(module, imports) {
|
|
161052
|
-
return __async$1(this, null, function* () {
|
|
161053
|
-
if (typeof Response === "function" && module instanceof Response) {
|
|
161054
|
-
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
161055
|
-
try {
|
|
161056
|
-
return yield WebAssembly.instantiateStreaming(module, imports);
|
|
161057
|
-
} catch (e) {
|
|
161058
|
-
if (module.headers.get("Content-Type") != "application/wasm") {
|
|
161059
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
161060
|
-
} else {
|
|
161061
|
-
throw e;
|
|
161062
|
-
}
|
|
161063
|
-
}
|
|
161064
|
-
}
|
|
161065
|
-
const bytes = yield module.arrayBuffer();
|
|
161066
|
-
return yield WebAssembly.instantiate(bytes, imports);
|
|
161067
|
-
} else {
|
|
161068
|
-
const instance = yield WebAssembly.instantiate(module, imports);
|
|
161069
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
161070
|
-
return { instance, module };
|
|
161071
|
-
} else {
|
|
161072
|
-
return instance;
|
|
161073
|
-
}
|
|
161074
|
-
}
|
|
161075
|
-
});
|
|
161076
|
-
}
|
|
161077
|
-
__name(load, "load");
|
|
161078
|
-
function init2(input) {
|
|
161079
|
-
return __async$1(this, null, function* () {
|
|
161080
|
-
const imports = {};
|
|
161081
|
-
imports.wbg = {};
|
|
161082
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
161083
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
161084
|
-
return addHeapObject(ret);
|
|
161085
|
-
};
|
|
161086
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
161087
|
-
takeObject(arg0);
|
|
161088
|
-
};
|
|
161089
|
-
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
161090
|
-
const obj = takeObject(arg0).original;
|
|
161091
|
-
if (obj.cnt-- == 1) {
|
|
161092
|
-
obj.a = 0;
|
|
161093
|
-
return true;
|
|
161094
|
-
}
|
|
161095
|
-
const ret = false;
|
|
161096
|
-
return ret;
|
|
161097
|
-
};
|
|
161098
|
-
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
161099
|
-
const ret = getObject(arg0);
|
|
161100
|
-
return addHeapObject(ret);
|
|
161101
|
-
};
|
|
161102
|
-
imports.wbg.__wbg_fetch_811d43d6bdcad5b1 = function(arg0) {
|
|
161103
|
-
const ret = fetch(getObject(arg0));
|
|
161104
|
-
return addHeapObject(ret);
|
|
161105
|
-
};
|
|
161106
|
-
imports.wbg.__wbg_fetch_bf56e2a9f0644e3f = function(arg0, arg1) {
|
|
161107
|
-
const ret = getObject(arg0).fetch(getObject(arg1));
|
|
161108
|
-
return addHeapObject(ret);
|
|
161109
|
-
};
|
|
161110
|
-
imports.wbg.__wbg_new_89d7f088c1c45353 = function() {
|
|
161111
|
-
return handleError(function() {
|
|
161112
|
-
const ret = new Headers();
|
|
161113
|
-
return addHeapObject(ret);
|
|
161114
|
-
}, arguments);
|
|
161115
|
-
};
|
|
161116
|
-
imports.wbg.__wbg_append_f4f93bc73c45ee3e = function() {
|
|
161117
|
-
return handleError(function(arg0, arg1, arg2, arg3, arg4) {
|
|
161118
|
-
getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
161119
|
-
}, arguments);
|
|
161120
|
-
};
|
|
161121
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
161122
|
-
const obj = getObject(arg1);
|
|
161123
|
-
const ret = typeof obj === "string" ? obj : void 0;
|
|
161124
|
-
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161125
|
-
var len0 = WASM_VECTOR_LEN;
|
|
161126
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
161127
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
161128
|
-
};
|
|
161129
|
-
imports.wbg.__wbg_instanceof_Response_ccfeb62399355bcd = function(arg0) {
|
|
161130
|
-
const ret = getObject(arg0) instanceof Response;
|
|
161131
|
-
return ret;
|
|
161132
|
-
};
|
|
161133
|
-
imports.wbg.__wbg_url_06c0f822d68d195c = function(arg0, arg1) {
|
|
161134
|
-
const ret = getObject(arg1).url;
|
|
161135
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161136
|
-
const len0 = WASM_VECTOR_LEN;
|
|
161137
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
161138
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
161139
|
-
};
|
|
161140
|
-
imports.wbg.__wbg_status_600fd8b881393898 = function(arg0) {
|
|
161141
|
-
const ret = getObject(arg0).status;
|
|
161142
|
-
return ret;
|
|
161143
|
-
};
|
|
161144
|
-
imports.wbg.__wbg_headers_9e7f2c05a9b962ea = function(arg0) {
|
|
161145
|
-
const ret = getObject(arg0).headers;
|
|
161146
|
-
return addHeapObject(ret);
|
|
161147
|
-
};
|
|
161148
|
-
imports.wbg.__wbg_arrayBuffer_5a99283a3954c850 = function() {
|
|
161149
|
-
return handleError(function(arg0) {
|
|
161150
|
-
const ret = getObject(arg0).arrayBuffer();
|
|
161151
|
-
return addHeapObject(ret);
|
|
161152
|
-
}, arguments);
|
|
161153
|
-
};
|
|
161154
|
-
imports.wbg.__wbg_newwithstrandinit_fd99688f189f053e = function() {
|
|
161155
|
-
return handleError(function(arg0, arg1, arg2) {
|
|
161156
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
|
|
161157
|
-
return addHeapObject(ret);
|
|
161158
|
-
}, arguments);
|
|
161159
|
-
};
|
|
161160
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
161161
|
-
const val = getObject(arg0);
|
|
161162
|
-
const ret = typeof val === "object" && val !== null;
|
|
161163
|
-
return ret;
|
|
161164
|
-
};
|
|
161165
|
-
imports.wbg.__wbg_self_86b4b13392c7af56 = function() {
|
|
161166
|
-
return handleError(function() {
|
|
161167
|
-
const ret = self.self;
|
|
161168
|
-
return addHeapObject(ret);
|
|
161169
|
-
}, arguments);
|
|
161170
|
-
};
|
|
161171
|
-
imports.wbg.__wbg_crypto_b8c92eaac23d0d80 = function(arg0) {
|
|
161172
|
-
const ret = getObject(arg0).crypto;
|
|
161173
|
-
return addHeapObject(ret);
|
|
161174
|
-
};
|
|
161175
|
-
imports.wbg.__wbg_msCrypto_9ad6677321a08dd8 = function(arg0) {
|
|
161176
|
-
const ret = getObject(arg0).msCrypto;
|
|
161177
|
-
return addHeapObject(ret);
|
|
161178
|
-
};
|
|
161179
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
161180
|
-
const ret = getObject(arg0) === void 0;
|
|
161181
|
-
return ret;
|
|
161182
|
-
};
|
|
161183
|
-
imports.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81 = function() {
|
|
161184
|
-
const ret = module;
|
|
161185
|
-
return addHeapObject(ret);
|
|
161186
|
-
};
|
|
161187
|
-
imports.wbg.__wbg_require_f5521a5b85ad2542 = function(arg0, arg1, arg2) {
|
|
161188
|
-
const ret = getObject(arg0).require(getStringFromWasm0(arg1, arg2));
|
|
161189
|
-
return addHeapObject(ret);
|
|
161190
|
-
};
|
|
161191
|
-
imports.wbg.__wbg_getRandomValues_dd27e6b0652b3236 = function(arg0) {
|
|
161192
|
-
const ret = getObject(arg0).getRandomValues;
|
|
161193
|
-
return addHeapObject(ret);
|
|
161194
|
-
};
|
|
161195
|
-
imports.wbg.__wbg_getRandomValues_e57c9b75ddead065 = function(arg0, arg1) {
|
|
161196
|
-
getObject(arg0).getRandomValues(getObject(arg1));
|
|
161197
|
-
};
|
|
161198
|
-
imports.wbg.__wbg_randomFillSync_d2ba53160aec6aba = function(arg0, arg1, arg2) {
|
|
161199
|
-
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
161200
|
-
};
|
|
161201
|
-
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
161202
|
-
const ret = typeof getObject(arg0) === "function";
|
|
161203
|
-
return ret;
|
|
161204
|
-
};
|
|
161205
|
-
imports.wbg.__wbg_newnoargs_e23b458e372830de = function(arg0, arg1) {
|
|
161206
|
-
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
161207
|
-
return addHeapObject(ret);
|
|
161208
|
-
};
|
|
161209
|
-
imports.wbg.__wbg_next_cabb70b365520721 = function(arg0) {
|
|
161210
|
-
const ret = getObject(arg0).next;
|
|
161211
|
-
return addHeapObject(ret);
|
|
161212
|
-
};
|
|
161213
|
-
imports.wbg.__wbg_next_bf3d83fc18df496e = function() {
|
|
161214
|
-
return handleError(function(arg0) {
|
|
161215
|
-
const ret = getObject(arg0).next();
|
|
161216
|
-
return addHeapObject(ret);
|
|
161217
|
-
}, arguments);
|
|
161218
|
-
};
|
|
161219
|
-
imports.wbg.__wbg_done_040f966faa9a72b3 = function(arg0) {
|
|
161220
|
-
const ret = getObject(arg0).done;
|
|
161221
|
-
return ret;
|
|
161222
|
-
};
|
|
161223
|
-
imports.wbg.__wbg_value_419afbd9b9574c4c = function(arg0) {
|
|
161224
|
-
const ret = getObject(arg0).value;
|
|
161225
|
-
return addHeapObject(ret);
|
|
161226
|
-
};
|
|
161227
|
-
imports.wbg.__wbg_iterator_4832ef1f15b0382b = function() {
|
|
161228
|
-
const ret = Symbol.iterator;
|
|
161229
|
-
return addHeapObject(ret);
|
|
161230
|
-
};
|
|
161231
|
-
imports.wbg.__wbg_get_a9cab131e3152c49 = function() {
|
|
161232
|
-
return handleError(function(arg0, arg1) {
|
|
161233
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
161234
|
-
return addHeapObject(ret);
|
|
161235
|
-
}, arguments);
|
|
161236
|
-
};
|
|
161237
|
-
imports.wbg.__wbg_call_ae78342adc33730a = function() {
|
|
161238
|
-
return handleError(function(arg0, arg1) {
|
|
161239
|
-
const ret = getObject(arg0).call(getObject(arg1));
|
|
161240
|
-
return addHeapObject(ret);
|
|
161241
|
-
}, arguments);
|
|
161242
|
-
};
|
|
161243
|
-
imports.wbg.__wbg_new_36359baae5a47e27 = function() {
|
|
161244
|
-
const ret = new Object();
|
|
161245
|
-
return addHeapObject(ret);
|
|
161246
|
-
};
|
|
161247
|
-
imports.wbg.__wbg_call_3ed288a247f13ea5 = function() {
|
|
161248
|
-
return handleError(function(arg0, arg1, arg2) {
|
|
161249
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
161250
|
-
return addHeapObject(ret);
|
|
161251
|
-
}, arguments);
|
|
161252
|
-
};
|
|
161253
|
-
imports.wbg.__wbg_getTime_bffb1c09df09618b = function(arg0) {
|
|
161254
|
-
const ret = getObject(arg0).getTime();
|
|
161255
|
-
return ret;
|
|
161256
|
-
};
|
|
161257
|
-
imports.wbg.__wbg_new0_0ff7eb5c1486f3ec = function() {
|
|
161258
|
-
const ret = new Date();
|
|
161259
|
-
return addHeapObject(ret);
|
|
161260
|
-
};
|
|
161261
|
-
imports.wbg.__wbg_new_37705eed627d5ed9 = function(arg0, arg1) {
|
|
161262
|
-
try {
|
|
161263
|
-
var state0 = { a: arg0, b: arg1 };
|
|
161264
|
-
var cb0 = /* @__PURE__ */ __name((arg02, arg12) => {
|
|
161265
|
-
const a = state0.a;
|
|
161266
|
-
state0.a = 0;
|
|
161267
|
-
try {
|
|
161268
|
-
return __wbg_adapter_110(a, state0.b, arg02, arg12);
|
|
161269
|
-
} finally {
|
|
161270
|
-
state0.a = a;
|
|
161271
|
-
}
|
|
161272
|
-
}, "cb0");
|
|
161273
|
-
const ret = new Promise(cb0);
|
|
161274
|
-
return addHeapObject(ret);
|
|
161275
|
-
} finally {
|
|
161276
|
-
state0.a = state0.b = 0;
|
|
161277
|
-
}
|
|
161278
|
-
};
|
|
161279
|
-
imports.wbg.__wbg_resolve_a9a87bdd64e9e62c = function(arg0) {
|
|
161280
|
-
const ret = Promise.resolve(getObject(arg0));
|
|
161281
|
-
return addHeapObject(ret);
|
|
161282
|
-
};
|
|
161283
|
-
imports.wbg.__wbg_then_ce526c837d07b68f = function(arg0, arg1) {
|
|
161284
|
-
const ret = getObject(arg0).then(getObject(arg1));
|
|
161285
|
-
return addHeapObject(ret);
|
|
161286
|
-
};
|
|
161287
|
-
imports.wbg.__wbg_then_842e65b843962f56 = function(arg0, arg1, arg2) {
|
|
161288
|
-
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
161289
|
-
return addHeapObject(ret);
|
|
161290
|
-
};
|
|
161291
|
-
imports.wbg.__wbg_self_99737b4dcdf6f0d8 = function() {
|
|
161292
|
-
return handleError(function() {
|
|
161293
|
-
const ret = self.self;
|
|
161294
|
-
return addHeapObject(ret);
|
|
161295
|
-
}, arguments);
|
|
161296
|
-
};
|
|
161297
|
-
imports.wbg.__wbg_window_9b61fbbf3564c4fb = function() {
|
|
161298
|
-
return handleError(function() {
|
|
161299
|
-
const ret = window.window;
|
|
161300
|
-
return addHeapObject(ret);
|
|
161301
|
-
}, arguments);
|
|
161302
|
-
};
|
|
161303
|
-
imports.wbg.__wbg_globalThis_8e275ef40caea3a3 = function() {
|
|
161304
|
-
return handleError(function() {
|
|
161305
|
-
const ret = globalThis.globalThis;
|
|
161306
|
-
return addHeapObject(ret);
|
|
161307
|
-
}, arguments);
|
|
161308
|
-
};
|
|
161309
|
-
imports.wbg.__wbg_global_5de1e0f82bddcd27 = function() {
|
|
161310
|
-
return handleError(function() {
|
|
161311
|
-
const ret = global.global;
|
|
161312
|
-
return addHeapObject(ret);
|
|
161313
|
-
}, arguments);
|
|
161314
|
-
};
|
|
161315
|
-
imports.wbg.__wbg_buffer_7af23f65f6c64548 = function(arg0) {
|
|
161316
|
-
const ret = getObject(arg0).buffer;
|
|
161317
|
-
return addHeapObject(ret);
|
|
161318
|
-
};
|
|
161319
|
-
imports.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974 = function(arg0, arg1, arg2) {
|
|
161320
|
-
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
161321
|
-
return addHeapObject(ret);
|
|
161322
|
-
};
|
|
161323
|
-
imports.wbg.__wbg_new_cc9018bd6f283b6f = function(arg0) {
|
|
161324
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
161325
|
-
return addHeapObject(ret);
|
|
161326
|
-
};
|
|
161327
|
-
imports.wbg.__wbg_set_f25e869e4565d2a2 = function(arg0, arg1, arg2) {
|
|
161328
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
161329
|
-
};
|
|
161330
|
-
imports.wbg.__wbg_length_0acb1cf9bbaf8519 = function(arg0) {
|
|
161331
|
-
const ret = getObject(arg0).length;
|
|
161332
|
-
return ret;
|
|
161333
|
-
};
|
|
161334
|
-
imports.wbg.__wbg_newwithlength_8f0657faca9f1422 = function(arg0) {
|
|
161335
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
161336
|
-
return addHeapObject(ret);
|
|
161337
|
-
};
|
|
161338
|
-
imports.wbg.__wbg_subarray_da527dbd24eafb6b = function(arg0, arg1, arg2) {
|
|
161339
|
-
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
161340
|
-
return addHeapObject(ret);
|
|
161341
|
-
};
|
|
161342
|
-
imports.wbg.__wbg_has_ce995ec88636803d = function() {
|
|
161343
|
-
return handleError(function(arg0, arg1) {
|
|
161344
|
-
const ret = Reflect.has(getObject(arg0), getObject(arg1));
|
|
161345
|
-
return ret;
|
|
161346
|
-
}, arguments);
|
|
161347
|
-
};
|
|
161348
|
-
imports.wbg.__wbg_set_93b1c87ee2af852e = function() {
|
|
161349
|
-
return handleError(function(arg0, arg1, arg2) {
|
|
161350
|
-
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
161351
|
-
return ret;
|
|
161352
|
-
}, arguments);
|
|
161353
|
-
};
|
|
161354
|
-
imports.wbg.__wbg_stringify_c760003feffcc1f2 = function() {
|
|
161355
|
-
return handleError(function(arg0) {
|
|
161356
|
-
const ret = JSON.stringify(getObject(arg0));
|
|
161357
|
-
return addHeapObject(ret);
|
|
161358
|
-
}, arguments);
|
|
161359
|
-
};
|
|
161360
|
-
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
161361
|
-
const ret = debugString(getObject(arg1));
|
|
161362
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
161363
|
-
const len0 = WASM_VECTOR_LEN;
|
|
161364
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
161365
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
161366
|
-
};
|
|
161367
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
161368
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
161369
|
-
};
|
|
161370
|
-
imports.wbg.__wbindgen_memory = function() {
|
|
161371
|
-
const ret = wasm.memory;
|
|
161372
|
-
return addHeapObject(ret);
|
|
161373
|
-
};
|
|
161374
|
-
imports.wbg.__wbindgen_closure_wrapper10913 = function(arg0, arg1, arg2) {
|
|
161375
|
-
const ret = makeMutClosure(arg0, arg1, 3725, __wbg_adapter_24);
|
|
161376
|
-
return addHeapObject(ret);
|
|
161377
|
-
};
|
|
161378
|
-
if (typeof input === "string" || typeof Request === "function" && input instanceof Request || typeof URL === "function" && input instanceof URL) {
|
|
161379
|
-
input = fetch(input);
|
|
161380
|
-
}
|
|
161381
|
-
const { instance, module } = yield load(yield input, imports);
|
|
161382
|
-
wasm = instance.exports;
|
|
161383
|
-
init2.__wbindgen_wasm_module = module;
|
|
161384
|
-
return wasm;
|
|
161385
|
-
});
|
|
161386
|
-
}
|
|
161387
|
-
__name(init2, "init");
|
|
161388
|
-
var didkit_wasm_default = init2;
|
|
161389
|
-
var initialized = false;
|
|
161390
|
-
var init3 = /* @__PURE__ */ __name((arg = "https://cdn.filestackcontent.com/dlXanMvQCGDR76JXcBkA") => __async$1(void 0, null, function* () {
|
|
161391
|
-
if (initialized)
|
|
161392
|
-
return;
|
|
161393
|
-
initialized = true;
|
|
161394
|
-
return didkit_wasm_default(arg);
|
|
161395
|
-
}), "init");
|
|
161396
|
-
var didkit_default = init3;
|
|
161397
|
-
var getDidKitPlugin = /* @__PURE__ */ __name((input) => __async$1(void 0, null, function* () {
|
|
161398
|
-
yield didkit_default(input);
|
|
161399
|
-
const memoizedDids = {};
|
|
161400
|
-
return {
|
|
161401
|
-
pluginMethods: {
|
|
161402
|
-
generateEd25519KeyFromBytes: (_wallet, bytes) => JSON.parse(generateEd25519KeyFromBytes(bytes)),
|
|
161403
|
-
generateSecp256k1KeyFromBytes: (_wallet, bytes) => JSON.parse(generateSecp256k1KeyFromBytes(bytes)),
|
|
161404
|
-
keyToDid: (_wallet, type, keypair) => {
|
|
161405
|
-
const memoizedDid = memoizedDids[type];
|
|
161406
|
-
if (!memoizedDid) {
|
|
161407
|
-
const did = keyToDID(type, JSON.stringify(keypair));
|
|
161408
|
-
memoizedDids[type] = did;
|
|
161409
|
-
return did;
|
|
161410
|
-
}
|
|
161411
|
-
return memoizedDid;
|
|
161412
|
-
},
|
|
161413
|
-
keyToVerificationMethod: (_wallet, type, keypair) => __async$1(void 0, null, function* () {
|
|
161414
|
-
return keyToVerificationMethod(type, JSON.stringify(keypair));
|
|
161415
|
-
}),
|
|
161416
|
-
issueCredential: (_wallet, credential, options, keypair) => __async$1(void 0, null, function* () {
|
|
161417
|
-
return JSON.parse(yield issueCredential2(JSON.stringify(credential), JSON.stringify(options), JSON.stringify(keypair)));
|
|
161418
|
-
}),
|
|
161419
|
-
verifyCredential: (_wallet, credential) => __async$1(void 0, null, function* () {
|
|
161420
|
-
return JSON.parse(yield verifyCredential3(JSON.stringify(credential), "{}"));
|
|
161421
|
-
}),
|
|
161422
|
-
issuePresentation: (_wallet, presentation, options, keypair) => __async$1(void 0, null, function* () {
|
|
161423
|
-
return JSON.parse(yield issuePresentation2(JSON.stringify(presentation), JSON.stringify(options), JSON.stringify(keypair)));
|
|
161424
|
-
}),
|
|
161425
|
-
verifyPresentation: (_wallet, presentation) => __async$1(void 0, null, function* () {
|
|
161426
|
-
return JSON.parse(yield verifyPresentation2(JSON.stringify(presentation), "{}"));
|
|
161427
|
-
})
|
|
161428
|
-
}
|
|
161429
|
-
};
|
|
161430
|
-
}), "getDidKitPlugin");
|
|
161431
|
-
var walletFromKey = /* @__PURE__ */ __name((_0, ..._1) => __async$1(void 0, [_0, ..._1], function* (key2, {
|
|
161432
|
-
ceramicIdx = defaultCeramicIDXArgs,
|
|
161433
|
-
didkit,
|
|
161434
|
-
defaultContents = [],
|
|
161435
|
-
ethereumConfig = defaultEthereumArgs
|
|
160924
|
+
var emptyWallet = /* @__PURE__ */ __name((..._0) => __async$1(void 0, [..._0], function* ({
|
|
160925
|
+
didkit
|
|
161436
160926
|
} = {}) {
|
|
161437
|
-
const didkitWallet = yield (yield generateWallet(
|
|
161438
|
-
const
|
|
161439
|
-
const didkeyAndVCWallet = yield didkeyWallet.addPlugin(yield getVCPlugin(didkeyWallet));
|
|
161440
|
-
const idxWallet = yield didkeyAndVCWallet.addPlugin(yield getIDXPlugin(didkeyAndVCWallet, ceramicIdx));
|
|
161441
|
-
const expirationWallet = yield idxWallet.addPlugin(ExpirationPlugin(idxWallet));
|
|
161442
|
-
const wallet = yield expirationWallet.addPlugin(getEthereumPlugin(expirationWallet, ethereumConfig));
|
|
160927
|
+
const didkitWallet = yield (yield generateWallet()).addPlugin(yield getDidKitPlugin(didkit));
|
|
160928
|
+
const wallet = yield didkitWallet.addPlugin(ExpirationPlugin(didkitWallet));
|
|
161443
160929
|
return {
|
|
161444
160930
|
_wallet: wallet,
|
|
161445
|
-
|
|
161446
|
-
|
|
161447
|
-
issueCredential: wallet.pluginMethods.issueCredential,
|
|
161448
|
-
verifyCredential: verifyCredential2(wallet),
|
|
161449
|
-
issuePresentation: wallet.pluginMethods.issuePresentation,
|
|
161450
|
-
verifyPresentation: wallet.pluginMethods.verifyPresentation,
|
|
161451
|
-
getCredential: wallet.pluginMethods.getVerifiableCredentialFromIdx,
|
|
161452
|
-
getCredentials: wallet.pluginMethods.getVerifiableCredentialsFromIdx,
|
|
161453
|
-
getCredentialsList: () => __async$1(void 0, null, function* () {
|
|
161454
|
-
return (yield wallet.pluginMethods.getCredentialsListFromIdx()).credentials;
|
|
161455
|
-
}),
|
|
161456
|
-
publishCredential: wallet.pluginMethods.publishContentToCeramic,
|
|
161457
|
-
addCredential: (credential) => __async$1(void 0, null, function* () {
|
|
161458
|
-
yield wallet.pluginMethods.addVerifiableCredentialInIdx(credential);
|
|
161459
|
-
}),
|
|
161460
|
-
removeCredential: (title) => __async$1(void 0, null, function* () {
|
|
161461
|
-
yield wallet.pluginMethods.removeVerifiableCredentialInIdx(title);
|
|
161462
|
-
}),
|
|
161463
|
-
readFromCeramic: wallet.pluginMethods.readContentFromCeramic,
|
|
161464
|
-
getTestVc: wallet.pluginMethods.getTestVc,
|
|
161465
|
-
getTestVp: wallet.pluginMethods.getTestVp,
|
|
161466
|
-
checkMyEth: wallet.pluginMethods.checkMyEth,
|
|
161467
|
-
checkMyDai: wallet.pluginMethods.checkMyDai,
|
|
161468
|
-
checkMyUsdc: wallet.pluginMethods.checkMyUsdc
|
|
160931
|
+
verifyCredential: verifyCredential3(wallet),
|
|
160932
|
+
verifyPresentation: wallet.pluginMethods.verifyPresentation
|
|
161469
160933
|
};
|
|
161470
|
-
}), "
|
|
160934
|
+
}), "emptyWallet");
|
|
161471
160935
|
/*!
|
|
161472
160936
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
161473
160937
|
* (c) 2017-2021 Joachim Wester
|
|
@@ -161512,13 +160976,13 @@ const VCCard = ({ credential, issueeOverride, className = "" }) => {
|
|
|
161512
160976
|
const [vcVerification, setVCVerification] = React.useState([]);
|
|
161513
160977
|
React.useEffect(() => {
|
|
161514
160978
|
const verify = () => __async(void 0, null, function* () {
|
|
161515
|
-
const wallet = yield
|
|
160979
|
+
const wallet = yield emptyWallet();
|
|
161516
160980
|
const verification = yield wallet.verifyCredential(credential);
|
|
161517
160981
|
setVCVerification(verification);
|
|
161518
160982
|
setLoading(false);
|
|
161519
160983
|
});
|
|
161520
160984
|
verify();
|
|
161521
|
-
}, []);
|
|
160985
|
+
}, [credential]);
|
|
161522
160986
|
return /* @__PURE__ */ React__default["default"].createElement(VCDisplayCard.VCDisplayCard, {
|
|
161523
160987
|
credential,
|
|
161524
160988
|
issueeOverride,
|
|
@@ -161529,4 +160993,4 @@ const VCCard = ({ credential, issueeOverride, className = "" }) => {
|
|
|
161529
160993
|
};
|
|
161530
160994
|
|
|
161531
160995
|
exports.VCCard = VCCard;
|
|
161532
|
-
//# sourceMappingURL=VCCard-
|
|
160996
|
+
//# sourceMappingURL=VCCard-ef452696.js.map
|