@cheqd/did-provider-cheqd 4.4.1 → 4.5.0-develop.1

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 (75) hide show
  1. package/build/esm/did-manager/cheqd-did-provider.d.ts.map +1 -1
  2. package/build/esm/did-manager/cheqd-did-provider.js +2 -1
  3. package/build/esm/did-manager/cheqd-did-provider.js.map +1 -1
  4. package/build/esm/utils/helpers.d.ts +1 -1
  5. package/build/esm/utils/helpers.d.ts.map +1 -1
  6. package/build/tsconfig.esm.tsbuildinfo +1 -1
  7. package/build/tsconfig.types.tsbuildinfo +1 -1
  8. package/build/types/did-manager/cheqd-did-provider.d.ts.map +1 -1
  9. package/build/types/utils/helpers.d.ts +1 -1
  10. package/build/types/utils/helpers.d.ts.map +1 -1
  11. package/package.json +3 -9
  12. package/src/did-manager/cheqd-did-provider.ts +2 -0
  13. package/src/utils/helpers.ts +1 -1
  14. package/tsconfig.json +1 -1
  15. package/build/cjs/agent/ICheqd.d.ts +0 -769
  16. package/build/cjs/agent/ICheqd.d.ts.map +0 -1
  17. package/build/cjs/agent/ICheqd.js +0 -4399
  18. package/build/cjs/agent/ICheqd.js.map +0 -1
  19. package/build/cjs/agent/index.d.ts +0 -2
  20. package/build/cjs/agent/index.d.ts.map +0 -1
  21. package/build/cjs/agent/index.js +0 -18
  22. package/build/cjs/agent/index.js.map +0 -1
  23. package/build/cjs/did-manager/cheqd-did-provider.d.ts +0 -233
  24. package/build/cjs/did-manager/cheqd-did-provider.d.ts.map +0 -1
  25. package/build/cjs/did-manager/cheqd-did-provider.js +0 -750
  26. package/build/cjs/did-manager/cheqd-did-provider.js.map +0 -1
  27. package/build/cjs/did-manager/cheqd-did-resolver.d.ts +0 -26
  28. package/build/cjs/did-manager/cheqd-did-resolver.d.ts.map +0 -1
  29. package/build/cjs/did-manager/cheqd-did-resolver.js +0 -52
  30. package/build/cjs/did-manager/cheqd-did-resolver.js.map +0 -1
  31. package/build/cjs/did-manager/index.d.ts +0 -4
  32. package/build/cjs/did-manager/index.d.ts.map +0 -1
  33. package/build/cjs/did-manager/index.js +0 -20
  34. package/build/cjs/did-manager/index.js.map +0 -1
  35. package/build/cjs/did-manager/resolver.d.ts +0 -47
  36. package/build/cjs/did-manager/resolver.d.ts.map +0 -1
  37. package/build/cjs/did-manager/resolver.js +0 -75
  38. package/build/cjs/did-manager/resolver.js.map +0 -1
  39. package/build/cjs/dkg-threshold/index.d.ts +0 -2
  40. package/build/cjs/dkg-threshold/index.d.ts.map +0 -1
  41. package/build/cjs/dkg-threshold/index.js +0 -18
  42. package/build/cjs/dkg-threshold/index.js.map +0 -1
  43. package/build/cjs/dkg-threshold/lit-protocol/v2.d.ts +0 -95
  44. package/build/cjs/dkg-threshold/lit-protocol/v2.d.ts.map +0 -1
  45. package/build/cjs/dkg-threshold/lit-protocol/v2.js +0 -193
  46. package/build/cjs/dkg-threshold/lit-protocol/v2.js.map +0 -1
  47. package/build/cjs/dkg-threshold/lit-protocol/v3.d.ts +0 -95
  48. package/build/cjs/dkg-threshold/lit-protocol/v3.d.ts.map +0 -1
  49. package/build/cjs/dkg-threshold/lit-protocol/v3.js +0 -232
  50. package/build/cjs/dkg-threshold/lit-protocol/v3.js.map +0 -1
  51. package/build/cjs/dkg-threshold/lit-protocol/v6.d.ts +0 -131
  52. package/build/cjs/dkg-threshold/lit-protocol/v6.d.ts.map +0 -1
  53. package/build/cjs/dkg-threshold/lit-protocol/v6.js +0 -345
  54. package/build/cjs/dkg-threshold/lit-protocol/v6.js.map +0 -1
  55. package/build/cjs/index.d.ts +0 -9
  56. package/build/cjs/index.d.ts.map +0 -1
  57. package/build/cjs/index.js +0 -25
  58. package/build/cjs/index.js.map +0 -1
  59. package/build/cjs/utils/constants.d.ts +0 -2
  60. package/build/cjs/utils/constants.d.ts.map +0 -1
  61. package/build/cjs/utils/constants.js +0 -5
  62. package/build/cjs/utils/constants.js.map +0 -1
  63. package/build/cjs/utils/env.d.ts +0 -7
  64. package/build/cjs/utils/env.d.ts.map +0 -1
  65. package/build/cjs/utils/env.js +0 -19
  66. package/build/cjs/utils/env.js.map +0 -1
  67. package/build/cjs/utils/helpers.d.ts +0 -18
  68. package/build/cjs/utils/helpers.d.ts.map +0 -1
  69. package/build/cjs/utils/helpers.js +0 -112
  70. package/build/cjs/utils/helpers.js.map +0 -1
  71. package/build/cjs/utils/index.d.ts +0 -3
  72. package/build/cjs/utils/index.d.ts.map +0 -1
  73. package/build/cjs/utils/index.js +0 -19
  74. package/build/cjs/utils/index.js.map +0 -1
  75. package/build/tsconfig.cjs.tsbuildinfo +0 -1
@@ -1,345 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.LitContracts = exports.LitProtocol = exports.DefaultLitNetworkRPCUrls = exports.TxNonceFormats = exports.LitCompatibleCosmosChains = exports.LitNetworks = void 0;
27
- const amino_1 = require("@cosmjs/amino");
28
- const to_string_1 = require("uint8arrays/to-string");
29
- const crypto_1 = require("@cosmjs/crypto");
30
- const lit_node_client_1 = require("@lit-protocol/lit-node-client");
31
- const contracts_sdk_1 = require("@lit-protocol/contracts-sdk");
32
- const types_1 = require("@lit-protocol/types");
33
- const helpers_js_1 = require("../../utils/helpers.js");
34
- const env_js_1 = require("../../utils/env.js");
35
- const uuid_1 = require("uuid");
36
- const uint8arrays_1 = require("uint8arrays");
37
- const constants_js_1 = require("../../utils/constants.js");
38
- const auth_helpers_1 = require("@lit-protocol/auth-helpers");
39
- const ethers_1 = require("ethers");
40
- const constants_1 = require("@lit-protocol/constants");
41
- exports.LitNetworks = {
42
- datil: 'datil',
43
- datilTest: 'datil-test',
44
- datildev: 'datil-dev',
45
- localhost: 'localhost',
46
- };
47
- exports.LitCompatibleCosmosChains = {
48
- cosmos: 'cosmos',
49
- cheqdMainnet: 'cheqdMainnet',
50
- cheqdTestnet: 'cheqdTestnet',
51
- };
52
- exports.TxNonceFormats = { entropy: 'entropy', uuid: 'uuid', timestamp: 'timestamp' };
53
- exports.DefaultLitNetworkRPCUrls = {
54
- [exports.LitNetworks.datil]: constants_1.LIT_RPC.CHRONICLE,
55
- [exports.LitNetworks.datilTest]: constants_1.LIT_RPC.CHRONICLE_YELLOWSTONE,
56
- [exports.LitNetworks.datildev]: constants_1.LIT_RPC.CHRONICLE_YELLOWSTONE,
57
- [exports.LitNetworks.localhost]: constants_1.LIT_RPC.LOCAL_ANVIL,
58
- };
59
- class LitProtocol {
60
- client;
61
- litNetwork = exports.LitNetworks.datildev;
62
- chain = exports.LitCompatibleCosmosChains.cosmos;
63
- cosmosAuthWallet;
64
- constructor(options) {
65
- // validate options
66
- if (options.litNetwork && !Object.values(exports.LitNetworks).includes(options.litNetwork))
67
- throw new Error(`[did-provider-cheqd]: lit-protocol: Invalid LitNetwork: ${options.litNetwork}`);
68
- if (options.chain && !Object.values(exports.LitCompatibleCosmosChains).includes(options.chain))
69
- throw new Error(`[did-provider-cheqd]: lit-protocol: Invalid LitCompatibleCosmosChain: ${options.chain}`);
70
- // set options
71
- if (options.litNetwork)
72
- this.litNetwork = options.litNetwork;
73
- if (options.chain)
74
- this.chain = options.chain;
75
- this.cosmosAuthWallet = options.cosmosAuthWallet;
76
- // set client as per environment
77
- this.client = (function (that) {
78
- if (env_js_1.isNode)
79
- return new lit_node_client_1.LitNodeClientNodeJs({ litNetwork: that.litNetwork, debug: constants_js_1.LitProtocolDebugEnabled });
80
- if (env_js_1.isBrowser)
81
- return new lit_node_client_1.LitNodeClient({ litNetwork: that.litNetwork, debug: constants_js_1.LitProtocolDebugEnabled });
82
- throw new Error('[did-provider-cheqd]: lit-protocol: Unsupported runtime environment');
83
- })(this);
84
- }
85
- async connect() {
86
- return await this.client.connect();
87
- }
88
- async encrypt(secret, unifiedAccessControlConditions) {
89
- // encrypt
90
- const { ciphertext: encryptedString, dataToEncryptHash: stringHash } = (await this.client.encrypt({
91
- dataToEncrypt: secret,
92
- unifiedAccessControlConditions,
93
- }));
94
- return {
95
- encryptedString: (0, uint8arrays_1.fromString)(encryptedString, 'base64'),
96
- stringHash,
97
- };
98
- }
99
- async decrypt(encryptedString, stringHash, unifiedAccessControlConditions, capacityDelegationAuthSig) {
100
- // generate session signatures
101
- const sessionSigs = await this.client.getSessionSigs({
102
- chain: 'cheqd',
103
- resourceAbilityRequests: [
104
- {
105
- resource: new auth_helpers_1.LitAccessControlConditionResource('*'),
106
- ability: types_1.LitAbility.AccessControlConditionDecryption,
107
- },
108
- ],
109
- capabilityAuthSigs: capacityDelegationAuthSig ? [capacityDelegationAuthSig] : undefined,
110
- authNeededCallback: async ({}) => {
111
- // generate auth signature
112
- const authSig = await LitProtocol.generateAuthSignature(this.cosmosAuthWallet);
113
- return authSig;
114
- },
115
- });
116
- // decrypt
117
- const { decryptedData } = (await this.client.decrypt({
118
- chain: this.chain,
119
- ciphertext: encryptedString,
120
- dataToEncryptHash: stringHash,
121
- unifiedAccessControlConditions,
122
- sessionSigs,
123
- }));
124
- return (0, to_string_1.toString)(decryptedData, 'utf-8');
125
- }
126
- async delegateCapacitCredit(options) {
127
- return await this.client.createCapacityDelegationAuthSig({
128
- dAppOwnerWallet: options.dAppOwnerWallet,
129
- capacityTokenId: options.capacityTokenId,
130
- delegateeAddresses: options.delegateeAddresses,
131
- uses: options.uses,
132
- domain: options.domain,
133
- expiration: options.expiration,
134
- statement: options.statement,
135
- });
136
- }
137
- static async encryptDirect(data) {
138
- try {
139
- // generate symmetric key
140
- const symmetricKey = await (0, helpers_js_1.generateSymmetricKey)();
141
- // generate iv
142
- const iv = crypto.getRandomValues(new Uint8Array(12));
143
- // encrypt
144
- const encrypted = await crypto.subtle.encrypt({
145
- name: 'AES-GCM',
146
- iv,
147
- }, symmetricKey, data);
148
- // export symmetric key
149
- const exportedSymmetricKey = await crypto.subtle.exportKey('raw', symmetricKey);
150
- return {
151
- encryptedString: new Blob([iv, new Uint8Array(encrypted)]),
152
- stringHash: (0, to_string_1.toString)(new Uint8Array(await crypto.subtle.digest('SHA-256', data)), 'hex'),
153
- symmetricKey: new Uint8Array(exportedSymmetricKey),
154
- };
155
- }
156
- catch (error) {
157
- // standardize error
158
- throw new Error(`[did-provider-cheqd]: symmetric-encryption: Encryption failed: ${error.message || error}`);
159
- }
160
- }
161
- static async decryptDirect(encryptedString, symmetricKey) {
162
- try {
163
- // import symmetric key
164
- const importedSymmetricKey = await crypto.subtle.importKey('raw', symmetricKey, {
165
- name: 'AES-GCM',
166
- }, true, ['encrypt', 'decrypt']);
167
- // extract iv and encrypted data
168
- const [iv, encryptedData] = await Promise.all([
169
- encryptedString.slice(0, 12).arrayBuffer(),
170
- encryptedString.slice(12).arrayBuffer(),
171
- ]);
172
- // decrypt
173
- const decrypted = await crypto.subtle.decrypt({
174
- name: 'AES-GCM',
175
- iv: new Uint8Array(iv),
176
- }, importedSymmetricKey, encryptedData);
177
- return new Uint8Array(decrypted);
178
- }
179
- catch (error) {
180
- // standardize error
181
- throw new Error(`[did-provider-cheqd]: symmetric-decryption: Decryption failed: ${error.message || error}`);
182
- }
183
- }
184
- static async create(options) {
185
- // instantiate underlying cosmos auth wallet
186
- if (!options.cosmosAuthWallet)
187
- options.cosmosAuthWallet = await amino_1.Secp256k1HdWallet.generate(24, {
188
- prefix: await LitProtocol.getCosmosWalletPrefix(options?.chain),
189
- });
190
- // validate top-level options chain
191
- if (!options?.chain)
192
- options.chain = exports.LitCompatibleCosmosChains.cheqdTestnet;
193
- // validate top-level options litNetwork
194
- if (!options?.litNetwork)
195
- options.litNetwork = exports.LitNetworks.datildev;
196
- const litProtocol = new LitProtocol(options);
197
- await litProtocol.connect();
198
- return litProtocol;
199
- }
200
- static async getCosmosWalletPrefix(chain) {
201
- switch (chain) {
202
- case exports.LitCompatibleCosmosChains.cosmos:
203
- return 'cosmos';
204
- case exports.LitCompatibleCosmosChains.cheqdMainnet:
205
- return 'cheqd';
206
- case exports.LitCompatibleCosmosChains.cheqdTestnet:
207
- return 'cheqd';
208
- default:
209
- return 'cheqd';
210
- }
211
- }
212
- static async generateAuthSignature(wallet) {
213
- const signerAddress = (await wallet.getAccounts())[0].address;
214
- const signData = await LitProtocol.generateSignData();
215
- const signDoc = await LitProtocol.generateSignDoc(signerAddress, signData);
216
- const result = await wallet.signAmino(signerAddress, signDoc);
217
- return {
218
- address: signerAddress,
219
- derivedVia: 'cosmos.signArbitrary',
220
- sig: result.signature.signature,
221
- signedMessage: (0, to_string_1.toString)((0, crypto_1.sha256)(new TextEncoder().encode(JSON.stringify(signDoc))), 'hex'), // <-- hex encoded sha256 hash of the json stringified signDoc
222
- };
223
- }
224
- static async generateSignDoc(address, data) {
225
- return {
226
- account_number: '0',
227
- chain_id: '',
228
- fee: {
229
- amount: [],
230
- gas: '0',
231
- },
232
- memo: '',
233
- msgs: [
234
- {
235
- type: 'sign/MsgSignData',
236
- value: {
237
- data: (0, to_string_1.toString)(data, 'base64'),
238
- signer: address,
239
- },
240
- },
241
- ],
242
- sequence: '0',
243
- }; // <-- should be sorted alphabetically
244
- }
245
- static async generateSignData() {
246
- return new TextEncoder().encode(`I am creating an account to use Lit Protocol at 2023-02-21T16:40:15.305Z`); // <-- lit nodes search for this string in the signData
247
- }
248
- static async generateTxNonce(format, entropyLength) {
249
- switch (format) {
250
- case exports.TxNonceFormats.entropy:
251
- return (0, to_string_1.toString)(await (0, helpers_js_1.randomBytes)(entropyLength || 64), 'hex');
252
- case exports.TxNonceFormats.uuid:
253
- return (0, uuid_1.v4)();
254
- case exports.TxNonceFormats.timestamp:
255
- return new Date().toISOString();
256
- default:
257
- return (0, uuid_1.v4)();
258
- }
259
- }
260
- static async generateCosmosAccessControlConditionBalance(returnValueTest, chain = exports.LitCompatibleCosmosChains.cheqdTestnet, address = ':userAddress') {
261
- return {
262
- conditionType: 'cosmos',
263
- path: `/cosmos/bank/v1beta1/balances/${address}`,
264
- chain,
265
- returnValueTest,
266
- };
267
- }
268
- static async generateCosmosAccessControlConditionTransactionMemo(returnValueTest, amount, sender, recipient = ':userAddress', chain = exports.LitCompatibleCosmosChains.cheqdTestnet) {
269
- return {
270
- conditionType: 'cosmos',
271
- path: `/cosmos/tx/v1beta1/txs?events=transfer.recipient='${recipient}'&events=transfer.sender='${sender}'&events=transfer.amount='${amount}'&order_by=2`,
272
- chain,
273
- returnValueTest,
274
- };
275
- }
276
- static async generateCosmosAccessControlConditionInverseTimelock(returnValueTest, amount, recipient = ':userAddress', blockHeight = 'latest', chain = exports.LitCompatibleCosmosChains.cheqdTestnet) {
277
- return {
278
- conditionType: 'cosmos',
279
- path: `/cosmos/tx/v1beta1/txs?events=transfer.recipient='${recipient}'&events=transfer.amount='${amount}'&order_by=2&pagination.limit=1`,
280
- chain,
281
- method: 'timelock',
282
- parameters: [blockHeight],
283
- returnValueTest,
284
- };
285
- }
286
- }
287
- exports.LitProtocol = LitProtocol;
288
- class LitContracts {
289
- client;
290
- litNetwork = exports.LitNetworks.datildev;
291
- ethereumAuthWallet;
292
- constructor(options) {
293
- // validate options
294
- if (options.litNetwork && !Object.values(exports.LitNetworks).includes(options.litNetwork))
295
- throw new Error(`[did-provider-cheqd]: lit-contracts: Invalid LitNetwork: ${options.litNetwork}`);
296
- // set options
297
- if (options.litNetwork)
298
- this.litNetwork = options.litNetwork;
299
- this.ethereumAuthWallet = options.ethereumAuthWallet;
300
- // set client
301
- this.client = new contracts_sdk_1.LitContracts({ signer: this.ethereumAuthWallet, network: this.litNetwork });
302
- }
303
- async connect() {
304
- return await this.client.connect();
305
- }
306
- async mintCapacityCredits(options) {
307
- return await this.client.mintCapacityCreditsNFT({
308
- requestsPerDay: options.requestsPerDay,
309
- requestsPerSecond: options.requestsPerSecond,
310
- requestsPerKilosecond: options.requestsPerKilosecond,
311
- daysUntilUTCMidnightExpiration: options.effectiveDays,
312
- });
313
- }
314
- static async create(options) {
315
- // instantiate underlying ethereum auth wallet
316
- if (!options.ethereumAuthWallet)
317
- options.ethereumAuthWallet = await LitContracts.generateRandomEthereumAuthWallet();
318
- // validate top-level options litNetwork
319
- if (!options?.litNetwork)
320
- options.litNetwork = exports.LitNetworks.datildev;
321
- const litContracts = new LitContracts(options);
322
- await litContracts.connect();
323
- return litContracts;
324
- }
325
- static async generateRandomEthereumAuthWallet() {
326
- // generate private key + wallet
327
- return new ethers_1.ethers.Wallet(await LitContracts.generateRandomPrivateKey());
328
- }
329
- static async generateRandomPrivateKey(length = 32, raw = false) {
330
- // ensure crypto, if applicable
331
- const crypto = await (async function () {
332
- if (env_js_1.isNode)
333
- return (await Promise.resolve().then(() => __importStar(require('crypto')))).default;
334
- if (env_js_1.isBrowser)
335
- return window.crypto;
336
- throw new Error('[did-provider-cheqd]: lit-contracts: Unsupported runtime environment');
337
- })();
338
- // generate random raw private key
339
- const rawPrivateKey = crypto.getRandomValues(new Uint8Array(length));
340
- // return as per request
341
- return (raw ? rawPrivateKey : `0x${(0, to_string_1.toString)(rawPrivateKey, 'hex')}`);
342
- }
343
- }
344
- exports.LitContracts = LitContracts;
345
- //# sourceMappingURL=v6.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v6.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CAAC,KAAK,CAAC,wBAAwB,CACpC,MAAM,GAAG,EAAE,EACX,GAAG,GAAG,KAAK;QAEX,+BAA+B;QAC/B,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK;YAC1B,IAAI,eAAM;gBAAE,OAAO,CAAC,wDAAa,QAAQ,GAAC,CAAC,CAAC,OAAiB,CAAC;YAC9D,IAAI,kBAAS;gBAAE,OAAO,MAAM,CAAC,MAAM,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;QACzF,CAAC,CAAC,EAAE,CAAC;QAEL,kCAAkC;QAClC,MAAM,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAErE,wBAAwB;QACxB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,IAAA,oBAAQ,EAAC,aAAa,EAAE,KAAK,CAAC,EAAE,CAAM,CAAC;IAC3E,CAAC;CACD;AAlED,oCAkEC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * @public
3
- */
4
- export * from './did-manager/cheqd-did-provider.js';
5
- export * from './did-manager/cheqd-did-resolver.js';
6
- export * from './did-manager/resolver.js';
7
- export * from './dkg-threshold/index.js';
8
- export * from './agent/index.js';
9
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC"}
@@ -1,25 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- /**
18
- * @public
19
- */
20
- __exportStar(require("./did-manager/cheqd-did-provider.js"), exports);
21
- __exportStar(require("./did-manager/cheqd-did-resolver.js"), exports);
22
- __exportStar(require("./did-manager/resolver.js"), exports);
23
- __exportStar(require("./dkg-threshold/index.js"), exports);
24
- __exportStar(require("./agent/index.js"), exports);
25
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,sEAAoD;AACpD,sEAAoD;AACpD,4DAA0C;AAC1C,2DAAyC;AACzC,mDAAiC"}
@@ -1,2 +0,0 @@
1
- export declare const LitProtocolDebugEnabled: boolean;
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,SAA4C,CAAC"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LitProtocolDebugEnabled = void 0;
4
- exports.LitProtocolDebugEnabled = process.env.LIT_PROTOCOL_DEBUG === 'true';
5
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,uBAAuB,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const isBrowser: boolean;
2
- export declare const isNode: boolean;
3
- export declare const isWebWorker: boolean;
4
- export declare const isJsDom: boolean;
5
- export declare const isReactNative: boolean;
6
- export declare const isElectron: boolean;
7
- //# sourceMappingURL=env.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../../src/utils/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,SAA0E,CAAC;AACjG,eAAO,MAAM,MAAM,SAA8F,CAAC;AAClH,eAAO,MAAM,WAAW,SAC+E,CAAC;AACxG,eAAO,MAAM,OAAO,SAGiE,CAAC;AACtF,eAAO,MAAM,aAAa,SAA0E,CAAC;AACrG,eAAO,MAAM,UAAU,SAQ8E,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isElectron = exports.isReactNative = exports.isJsDom = exports.isWebWorker = exports.isNode = exports.isBrowser = void 0;
4
- exports.isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
5
- exports.isNode = typeof process !== 'undefined' && process.versions != null && process.versions.node != null;
6
- exports.isWebWorker = typeof self === 'object' && self.constructor && self.constructor.name === 'DedicatedWorkerGlobalScope';
7
- exports.isJsDom = (typeof window !== 'undefined' && window.name === 'nodejs') ||
8
- (typeof navigator !== 'undefined' &&
9
- (navigator.userAgent.includes('jsdom') || navigator.userAgent.includes('Node.js')));
10
- exports.isReactNative = typeof navigator !== 'undefined' && navigator.product === 'ReactNative'; // use wisely: limited as of react-native v0.67 + navigator.product has been deprecated
11
- exports.isElectron = (typeof window !== 'undefined' &&
12
- typeof window.process === 'object' &&
13
- window.process.type ===
14
- 'renderer') ||
15
- (typeof navigator === 'object' &&
16
- typeof navigator.userAgent === 'string' &&
17
- navigator.userAgent.indexOf('Electron') >= 0) ||
18
- (typeof process === 'object' && typeof process.versions === 'object'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AAC,QAAQ,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- import { DIDDocument } from '@veramo/core-types';
2
- import { type GenerateOptions } from 'generate-password';
3
- import { EncodedList, EncodedListAsArray } from '../agent';
4
- export declare function isEncodedList(list: unknown): list is EncodedList;
5
- export declare function getEncodedList(list: unknown, validate?: boolean): EncodedListAsArray;
6
- export declare function generateSymmetricKey(params?: AesKeyGenParams): Promise<CryptoKey>;
7
- export declare function safeDeserialise<T>(string: string, deserialiser: (string: string, ...args: any[]) => T, deserialiserArgs?: any[], message?: string): Promise<T>;
8
- export declare function randomFromRange(min: number, max: number, notIn: number[]): Promise<number>;
9
- export declare function randomUniqueSubsetInRange(min: number, max: number, count: number): Promise<Array<number>>;
10
- export declare function randomBytes(length: number): Promise<Buffer>;
11
- export declare function randomUniqueSecret(options?: GenerateOptions): Promise<string>;
12
- export declare function initialiseIndexArray(length: number): Promise<Array<boolean>>;
13
- export declare function shuffleArray<T>(array: Array<T>): Promise<Array<T>>;
14
- export declare function toBlob(data: Uint8Array): Promise<Blob>;
15
- export declare function blobToHexString(blob: Blob): Promise<string>;
16
- export declare function unescapeUnicode(str: string): string;
17
- export declare function getControllers(didDocument: DIDDocument): string[];
18
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAA8B,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAErF,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE3D,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,WAAW,CAEhE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE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,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAInD;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,EAAE,CAWjE"}
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isEncodedList = isEncodedList;
4
- exports.getEncodedList = getEncodedList;
5
- exports.generateSymmetricKey = generateSymmetricKey;
6
- exports.safeDeserialise = safeDeserialise;
7
- exports.randomFromRange = randomFromRange;
8
- exports.randomUniqueSubsetInRange = randomUniqueSubsetInRange;
9
- exports.randomBytes = randomBytes;
10
- exports.randomUniqueSecret = randomUniqueSecret;
11
- exports.initialiseIndexArray = initialiseIndexArray;
12
- exports.shuffleArray = shuffleArray;
13
- exports.toBlob = toBlob;
14
- exports.blobToHexString = blobToHexString;
15
- exports.unescapeUnicode = unescapeUnicode;
16
- exports.getControllers = getControllers;
17
- const generate_password_1 = require("generate-password");
18
- const to_string_1 = require("uint8arrays/to-string");
19
- function isEncodedList(list) {
20
- return typeof list === 'string' && list.split('-').every((item) => typeof item === 'string' && item && item.length);
21
- }
22
- function getEncodedList(list, validate = true) {
23
- if (validate && !isEncodedList(list))
24
- throw new Error('Invalid encoded list');
25
- const [symmetricEncryptionCipherText, ThresholdEncryptionCipherText] = list.split('-');
26
- return [symmetricEncryptionCipherText, ThresholdEncryptionCipherText];
27
- }
28
- async function generateSymmetricKey(params) {
29
- return await crypto.subtle.generateKey(params || {
30
- name: 'AES-GCM',
31
- length: 256,
32
- }, true, ['encrypt', 'decrypt']);
33
- }
34
- async function safeDeserialise(string,
35
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
- deserialiser,
37
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
- deserialiserArgs = [], message) {
39
- try {
40
- return await deserialiser(string, ...deserialiserArgs);
41
- }
42
- catch (error) {
43
- return message
44
- ? (function () {
45
- throw new Error(`[did-provider-cheqd]: deserialise: ${message}: ${error.message || error}`);
46
- })()
47
- : (function () {
48
- throw error;
49
- })();
50
- }
51
- }
52
- async function randomFromRange(min, max, notIn) {
53
- const random = Math.floor(Math.random() * (max - min + 1) + min);
54
- if (notIn.includes(random)) {
55
- return await randomFromRange(min, max, notIn);
56
- }
57
- return random;
58
- }
59
- async function randomUniqueSubsetInRange(min, max, count) {
60
- const subset = [];
61
- for (let i = 0; i < count; i++) {
62
- subset.push(await randomFromRange(min, max, subset));
63
- }
64
- return subset;
65
- }
66
- async function randomBytes(length) {
67
- return Buffer.from(Array.from({ length }, () => Math.floor(Math.random() * 256)));
68
- }
69
- async function randomUniqueSecret(options) {
70
- return (0, generate_password_1.generate)({
71
- length: 64,
72
- numbers: true,
73
- symbols: true,
74
- uppercase: true,
75
- ...options,
76
- });
77
- }
78
- async function initialiseIndexArray(length) {
79
- return Array(length).fill(true);
80
- }
81
- async function shuffleArray(array) {
82
- const shuffled = array.sort(() => Math.random() - 0.5);
83
- return shuffled;
84
- }
85
- async function toBlob(data) {
86
- return new Blob([data]);
87
- }
88
- async function blobToHexString(blob) {
89
- // buffer from blob
90
- const buffer = await blob.arrayBuffer();
91
- // convert buffer to uint8Array
92
- const uint8Array = new Uint8Array(buffer);
93
- return (0, to_string_1.toString)(uint8Array, 'hex');
94
- }
95
- function unescapeUnicode(str) {
96
- return str.replace(/\\u([a-fA-F0-9]{4})/g, (m, cc) => {
97
- return String.fromCharCode(parseInt(cc, 16));
98
- });
99
- }
100
- function getControllers(didDocument) {
101
- const controllers = [];
102
- if (didDocument.controller) {
103
- if (typeof didDocument.controller === 'string') {
104
- controllers.push(didDocument.controller);
105
- }
106
- if (Array.isArray(didDocument.controller)) {
107
- controllers.push(...didDocument.controller);
108
- }
109
- }
110
- return controllers;
111
- }
112
- //# sourceMappingURL=helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":";;AAKA,sCAEC;AAED,wCAIC;AAED,oDASC;AAED,0C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AAK,QAAQ,EAAE,CAAC;YAChD,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC1C,CAAC;QACD,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,CAAC;YAC3C,WAAW,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7C,CAAC;IACF,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './env.js';
2
- export * from './helpers.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./env.js"), exports);
18
- __exportStar(require("./helpers.js"), exports);
19
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,+CAA6B"}