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