@ownables/platform-browser 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/core/src/index.d.ts +19 -0
  2. package/dist/core/src/index.d.ts.map +1 -0
  3. package/dist/core/src/index.js +18 -0
  4. package/dist/core/src/index.js.map +1 -0
  5. package/dist/core/src/interfaces/core.d.ts +49 -0
  6. package/dist/core/src/interfaces/core.d.ts.map +1 -0
  7. package/dist/core/src/interfaces/core.js +2 -0
  8. package/dist/core/src/interfaces/core.js.map +1 -0
  9. package/dist/core/src/logger.d.ts +3 -0
  10. package/dist/core/src/logger.d.ts.map +1 -0
  11. package/dist/core/src/logger.js +2 -0
  12. package/dist/core/src/logger.js.map +1 -0
  13. package/dist/core/src/progress.d.ts +3 -0
  14. package/dist/core/src/progress.d.ts.map +1 -0
  15. package/dist/core/src/progress.js +8 -0
  16. package/dist/core/src/progress.js.map +1 -0
  17. package/dist/core/src/services/EventChain.service.d.ts +45 -0
  18. package/dist/core/src/services/EventChain.service.d.ts.map +1 -0
  19. package/dist/core/src/services/EventChain.service.js +112 -0
  20. package/dist/core/src/services/EventChain.service.js.map +1 -0
  21. package/dist/core/src/services/Ownable.service.d.ts +56 -0
  22. package/dist/core/src/services/Ownable.service.d.ts.map +1 -0
  23. package/dist/core/src/services/Ownable.service.js +411 -0
  24. package/dist/core/src/services/Ownable.service.js.map +1 -0
  25. package/dist/core/src/services/Polling.service.d.ts +31 -0
  26. package/dist/core/src/services/Polling.service.d.ts.map +1 -0
  27. package/dist/core/src/services/Polling.service.js +109 -0
  28. package/dist/core/src/services/Polling.service.js.map +1 -0
  29. package/dist/core/src/services/SIWE.service.d.ts +16 -0
  30. package/dist/core/src/services/SIWE.service.d.ts.map +1 -0
  31. package/dist/core/src/services/SIWE.service.js +123 -0
  32. package/dist/core/src/services/SIWE.service.js.map +1 -0
  33. package/dist/core/src/services/StateStoreRecordStore.service.d.ts +13 -0
  34. package/dist/core/src/services/StateStoreRecordStore.service.d.ts.map +1 -0
  35. package/dist/core/src/services/StateStoreRecordStore.service.js +76 -0
  36. package/dist/core/src/services/StateStoreRecordStore.service.js.map +1 -0
  37. package/dist/core/src/types/Authority.d.ts +40 -0
  38. package/dist/core/src/types/Authority.d.ts.map +1 -0
  39. package/dist/core/src/types/Authority.js +2 -0
  40. package/dist/core/src/types/Authority.js.map +1 -0
  41. package/dist/core/src/types/EventChainStore.d.ts +11 -0
  42. package/dist/core/src/types/EventChainStore.d.ts.map +1 -0
  43. package/dist/core/src/types/EventChainStore.js +2 -0
  44. package/dist/core/src/types/EventChainStore.js.map +1 -0
  45. package/dist/core/src/types/MessageInfo.d.ts +19 -0
  46. package/dist/core/src/types/MessageInfo.d.ts.map +1 -0
  47. package/dist/core/src/types/MessageInfo.js +2 -0
  48. package/dist/core/src/types/MessageInfo.js.map +1 -0
  49. package/dist/core/src/types/OwnableRuntime.d.ts +38 -0
  50. package/dist/core/src/types/OwnableRuntime.d.ts.map +1 -0
  51. package/dist/core/src/types/OwnableRuntime.js +2 -0
  52. package/dist/core/src/types/OwnableRuntime.js.map +1 -0
  53. package/dist/core/src/types/Polling.d.ts +14 -0
  54. package/dist/core/src/types/Polling.d.ts.map +1 -0
  55. package/dist/core/src/types/Polling.js +2 -0
  56. package/dist/core/src/types/Polling.js.map +1 -0
  57. package/dist/core/src/types/SIWE.d.ts +30 -0
  58. package/dist/core/src/types/SIWE.d.ts.map +1 -0
  59. package/dist/core/src/types/SIWE.js +2 -0
  60. package/dist/core/src/types/SIWE.js.map +1 -0
  61. package/dist/core/src/types/TypedCosmWasmMsg.d.ts +12 -0
  62. package/dist/core/src/types/TypedCosmWasmMsg.d.ts.map +1 -0
  63. package/dist/core/src/types/TypedCosmWasmMsg.js +2 -0
  64. package/dist/core/src/types/TypedCosmWasmMsg.js.map +1 -0
  65. package/dist/core/src/types/TypedDict.d.ts +4 -0
  66. package/dist/core/src/types/TypedDict.d.ts.map +1 -0
  67. package/dist/core/src/types/TypedDict.js +2 -0
  68. package/dist/core/src/types/TypedDict.js.map +1 -0
  69. package/dist/core/src/types/TypedOwnableInfo.d.ts +34 -0
  70. package/dist/core/src/types/TypedOwnableInfo.d.ts.map +1 -0
  71. package/dist/core/src/types/TypedOwnableInfo.js +2 -0
  72. package/dist/core/src/types/TypedOwnableInfo.js.map +1 -0
  73. package/dist/core/src/types/TypedPackage.d.ts +32 -0
  74. package/dist/core/src/types/TypedPackage.d.ts.map +1 -0
  75. package/dist/core/src/types/TypedPackage.js +2 -0
  76. package/dist/core/src/types/TypedPackage.js.map +1 -0
  77. package/dist/platform-browser/src/index.d.ts +7 -0
  78. package/dist/platform-browser/src/index.d.ts.map +1 -0
  79. package/dist/platform-browser/src/index.js +7 -0
  80. package/dist/platform-browser/src/index.js.map +1 -0
  81. package/dist/platform-browser/src/services/IDB.service.d.ts +29 -0
  82. package/dist/platform-browser/src/services/IDB.service.d.ts.map +1 -0
  83. package/dist/platform-browser/src/services/IDB.service.js +192 -0
  84. package/dist/platform-browser/src/services/IDB.service.js.map +1 -0
  85. package/dist/platform-browser/src/services/LocalStorage.service.d.ts +14 -0
  86. package/dist/platform-browser/src/services/LocalStorage.service.d.ts.map +1 -0
  87. package/dist/platform-browser/src/services/LocalStorage.service.js +57 -0
  88. package/dist/platform-browser/src/services/LocalStorage.service.js.map +1 -0
  89. package/dist/platform-browser/src/services/Package.service.d.ts +48 -0
  90. package/dist/platform-browser/src/services/Package.service.d.ts.map +1 -0
  91. package/dist/platform-browser/src/services/Package.service.js +443 -0
  92. package/dist/platform-browser/src/services/Package.service.js.map +1 -0
  93. package/dist/platform-browser/src/services/Relay.service.d.ts +59 -0
  94. package/dist/platform-browser/src/services/Relay.service.d.ts.map +1 -0
  95. package/dist/platform-browser/src/services/Relay.service.js +289 -0
  96. package/dist/platform-browser/src/services/Relay.service.js.map +1 -0
  97. package/dist/platform-browser/src/services/SessionStorage.service.d.ts +7 -0
  98. package/dist/platform-browser/src/services/SessionStorage.service.d.ts.map +1 -0
  99. package/dist/platform-browser/src/services/SessionStorage.service.js +16 -0
  100. package/dist/platform-browser/src/services/SessionStorage.service.js.map +1 -0
  101. package/dist/platform-browser/src/utils/calculateCid.d.ts +2 -0
  102. package/dist/platform-browser/src/utils/calculateCid.d.ts.map +1 -0
  103. package/dist/platform-browser/src/utils/calculateCid.js +18 -0
  104. package/dist/platform-browser/src/utils/calculateCid.js.map +1 -0
  105. package/package.json +7 -2
@@ -0,0 +1,123 @@
1
+ export class SIWEClient {
2
+ domain;
3
+ version = "1";
4
+ fetchFn;
5
+ now;
6
+ nonceGenerator;
7
+ constructor(domain, deps = {}) {
8
+ this.domain = domain || "localhost:8000";
9
+ this.fetchFn = deps.fetchFn ?? ((input, init) => fetch(input, init));
10
+ this.now = deps.now ?? (() => new Date());
11
+ this.nonceGenerator = deps.nonceGenerator;
12
+ }
13
+ generateNonce() {
14
+ if (this.nonceGenerator)
15
+ return this.nonceGenerator();
16
+ return (Math.random().toString(36).substring(2, 15) +
17
+ Math.random().toString(36).substring(2, 15));
18
+ }
19
+ createMessage(address, uri, chainId = 84532) {
20
+ return {
21
+ domain: this.domain,
22
+ address,
23
+ statement: "Sign in with Ethereum to the EQTY Relay",
24
+ uri,
25
+ version: this.version,
26
+ chainId,
27
+ nonce: this.generateNonce(),
28
+ issuedAt: this.now().toISOString(),
29
+ };
30
+ }
31
+ async signMessage(message, signer) {
32
+ const domain = {
33
+ name: "Sign-In with Ethereum",
34
+ version: this.version,
35
+ chainId: message.chainId,
36
+ };
37
+ const types = {
38
+ Message: [
39
+ { name: "domain", type: "string" },
40
+ { name: "address", type: "address" },
41
+ { name: "statement", type: "string" },
42
+ { name: "uri", type: "string" },
43
+ { name: "version", type: "string" },
44
+ { name: "chainId", type: "uint256" },
45
+ { name: "nonce", type: "string" },
46
+ { name: "issuedAt", type: "string" },
47
+ { name: "expirationTime", type: "string" },
48
+ { name: "notBefore", type: "string" },
49
+ { name: "requestId", type: "string" },
50
+ { name: "resources", type: "string[]" },
51
+ ],
52
+ };
53
+ const value = {
54
+ domain: message.domain,
55
+ address: message.address,
56
+ statement: message.statement || "",
57
+ uri: message.uri,
58
+ version: message.version,
59
+ chainId: message.chainId,
60
+ nonce: message.nonce,
61
+ issuedAt: message.issuedAt,
62
+ expirationTime: message.expirationTime || "",
63
+ notBefore: message.notBefore || "",
64
+ requestId: message.requestId || "",
65
+ resources: message.resources || [],
66
+ };
67
+ return await signer.signTypedData(domain, types, value);
68
+ }
69
+ async authenticate(signer, relayUrl, chainId = 84532) {
70
+ try {
71
+ const address = await signer.getAddress();
72
+ const uri = `${relayUrl}/auth/verify`;
73
+ const message = this.createMessage(address, uri, chainId);
74
+ const signature = await this.signMessage(message, signer);
75
+ const response = await this.fetchFn(`${relayUrl}/auth/verify`, {
76
+ method: "POST",
77
+ headers: {
78
+ "Content-Type": "application/json",
79
+ },
80
+ body: JSON.stringify({
81
+ message,
82
+ signature,
83
+ }),
84
+ });
85
+ if (!response.ok) {
86
+ const error = await response.json();
87
+ return {
88
+ success: false,
89
+ error: error.error || "Authentication failed",
90
+ };
91
+ }
92
+ const result = await response.json();
93
+ return {
94
+ success: true,
95
+ address: result.address,
96
+ token: result.token,
97
+ expiresIn: result.expiresIn,
98
+ };
99
+ }
100
+ catch (error) {
101
+ return {
102
+ success: false,
103
+ error: `Authentication failed: ${error instanceof Error ? error.message : String(error)}`,
104
+ };
105
+ }
106
+ }
107
+ async getNonce(relayUrl) {
108
+ try {
109
+ const response = await this.fetchFn(`${relayUrl}/auth/nonce`, {
110
+ method: "POST",
111
+ });
112
+ if (!response.ok) {
113
+ throw new Error("Failed to get nonce");
114
+ }
115
+ const result = await response.json();
116
+ return result.nonce;
117
+ }
118
+ catch (error) {
119
+ throw new Error(`Failed to get nonce: ${error instanceof Error ? error.message : String(error)}`);
120
+ }
121
+ }
122
+ }
123
+ //# sourceMappingURL=SIWE.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SI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AC,KAAK,IAAI,uBAAuB;iBAC9C,CAAC;YACJ,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACrC,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,SAAS,EAAE,MAAM,CAAC,SAAS;aAC5B,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,0BACL,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE;aACH,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,QAAgB;QAC7B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,QAAQ,aAAa,EAAE;gBAC5D,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;YAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;YACzC,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACrC,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,wBACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE,CACH,CAAC;QACJ,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,13 @@
1
+ import type { RecordStore, BridgedOwnableRecord, NftRef } from '../types/Authority';
2
+ import type { StateStore } from '../interfaces/core';
3
+ export default class StateStoreRecordStore implements RecordStore {
4
+ private readonly state;
5
+ constructor(state: StateStore);
6
+ put(record: BridgedOwnableRecord): Promise<void>;
7
+ getByCid(cid: string): Promise<BridgedOwnableRecord | undefined>;
8
+ hasCid(cid: string): Promise<boolean>;
9
+ getCidByNft(nft: NftRef): Promise<string | undefined>;
10
+ getByNft(nft: NftRef): Promise<BridgedOwnableRecord | undefined>;
11
+ listByPrevOwner(prevOwner: string): Promise<BridgedOwnableRecord[]>;
12
+ }
13
+ //# sourceMappingURL=StateStoreRecordStore.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateStoreRecordStore.service.d.ts","sourceRoot":"","sources":["../../../../../core/src/services/StateStoreRecordStore.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AA4BrD,MAAM,CAAC,OAAO,OAAO,qBAAsB,YAAW,WAAW;IACnD,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,UAAU;IAExC,GAAG,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkChD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAKhE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKrC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAKrD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC;IAMhE,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAQ1E"}
@@ -0,0 +1,76 @@
1
+ const STORE_BY_CID = 'records:by-cid';
2
+ const STORE_BY_NFT = 'records:index:nft';
3
+ const STORE_BY_OWNER = 'records:index:owner';
4
+ function normalizeAddress(address) {
5
+ return address.toLowerCase();
6
+ }
7
+ function ownerKey(owner) {
8
+ return normalizeAddress(owner);
9
+ }
10
+ function nftKey(nft) {
11
+ return `${nft.network.toLowerCase()}|${normalizeAddress(nft.address)}|${nft.id}`;
12
+ }
13
+ async function ensureStores(state) {
14
+ const stores = [STORE_BY_CID, STORE_BY_NFT, STORE_BY_OWNER];
15
+ const missing = await Promise.all(stores.map((store) => state.hasStore(store)));
16
+ const toCreate = stores.filter((_store, idx) => !missing[idx]);
17
+ if (toCreate.length > 0) {
18
+ await state.createStore(...toCreate);
19
+ }
20
+ }
21
+ export default class StateStoreRecordStore {
22
+ state;
23
+ constructor(state) {
24
+ this.state = state;
25
+ }
26
+ async put(record) {
27
+ await ensureStores(this.state);
28
+ const existing = await this.getByCid(record.cid);
29
+ const owner = ownerKey(record.prevOwner);
30
+ const nft = nftKey(record.nft);
31
+ await this.state.set(STORE_BY_CID, record.cid, record);
32
+ await this.state.set(STORE_BY_NFT, nft, record.cid);
33
+ const ownerCids = (await this.state.get(STORE_BY_OWNER, owner)) ?? [];
34
+ if (!ownerCids.includes(record.cid)) {
35
+ await this.state.set(STORE_BY_OWNER, owner, [...ownerCids, record.cid]);
36
+ }
37
+ if (!existing) {
38
+ return;
39
+ }
40
+ const oldOwner = ownerKey(existing.prevOwner);
41
+ const oldNft = nftKey(existing.nft);
42
+ if (oldNft !== nft) {
43
+ await this.state.delete(STORE_BY_NFT, oldNft);
44
+ }
45
+ if (oldOwner !== owner) {
46
+ const oldOwnerCids = (await this.state.get(STORE_BY_OWNER, oldOwner)) ?? [];
47
+ const next = oldOwnerCids.filter((cid) => cid !== record.cid);
48
+ await this.state.set(STORE_BY_OWNER, oldOwner, next);
49
+ }
50
+ }
51
+ async getByCid(cid) {
52
+ await ensureStores(this.state);
53
+ return (await this.state.get(STORE_BY_CID, cid));
54
+ }
55
+ async hasCid(cid) {
56
+ const record = await this.getByCid(cid);
57
+ return Boolean(record);
58
+ }
59
+ async getCidByNft(nft) {
60
+ await ensureStores(this.state);
61
+ return (await this.state.get(STORE_BY_NFT, nftKey(nft)));
62
+ }
63
+ async getByNft(nft) {
64
+ const cid = await this.getCidByNft(nft);
65
+ if (!cid)
66
+ return undefined;
67
+ return this.getByCid(cid);
68
+ }
69
+ async listByPrevOwner(prevOwner) {
70
+ await ensureStores(this.state);
71
+ const cids = (await this.state.get(STORE_BY_OWNER, ownerKey(prevOwner))) ?? [];
72
+ const records = await Promise.all(cids.map((cid) => this.getByCid(cid)));
73
+ return records.filter((record) => Boolean(record));
74
+ }
75
+ }
76
+ //# sourceMappingURL=StateStoreRecordStore.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StateStoreRecordStore.service.js","sourceRoot":"","sources":["../../../../../core/src/services/StateStoreRecordStore.service.ts"],"names":[],"mappings":"AAGA,MAAM,YAAY,GAAG,gBAAgB,CAAC;AACtC,MAAM,YAAY,GAAG,mBAAmB,CAAC;AACzC,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAE7C,SAAS,gBAAgB,CAAC,OAAe;IACvC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;AAC/B,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa;IAC7B,OAAO,gBAAgB,CAAC,KAAK,CAAC,CAAC;AACjC,CAAC;AAED,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,EAAE,EAAE,CAAC;AACnF,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,KAAiB;IAC3C,MAAM,MAAM,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;IAC5D,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,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AM,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,YAAY,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAuB,CAAC;IACjF,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,GAAW;QACxB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,SAAiB;QACrC,MAAM,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,IAAI,GACP,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,cAAc,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC,CAA0B,IAAI,EAAE,CAAC;QAE9F,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACzE,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAkC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IACrF,CAAC;CACF"}
@@ -0,0 +1,40 @@
1
+ export interface NftRef {
2
+ network: string;
3
+ address: string;
4
+ id: string;
5
+ }
6
+ export interface BridgedOwnableRecord {
7
+ cid: string;
8
+ prevOwner: string;
9
+ nft: NftRef;
10
+ createdAt: string;
11
+ }
12
+ export interface ImportedArchive {
13
+ cid: string;
14
+ chainJson: Record<string, unknown>;
15
+ chainFileName: 'eventChain.json' | 'chain.json';
16
+ packageFiles: string[];
17
+ }
18
+ export interface RecordStore {
19
+ put(record: BridgedOwnableRecord): Promise<void>;
20
+ getByCid(cid: string): Promise<BridgedOwnableRecord | undefined>;
21
+ hasCid(cid: string): Promise<boolean>;
22
+ getCidByNft(nft: NftRef): Promise<string | undefined>;
23
+ getByNft(nft: NftRef): Promise<BridgedOwnableRecord | undefined>;
24
+ listByPrevOwner(prevOwner: string): Promise<BridgedOwnableRecord[]>;
25
+ }
26
+ export interface ArchiveService {
27
+ importArchive(data: Uint8Array): Promise<ImportedArchive>;
28
+ hasPackage(cid: string): Promise<boolean>;
29
+ hasChain(cid: string): Promise<boolean>;
30
+ readChain(cid: string): Promise<Record<string, unknown>>;
31
+ readPackageZip(cid: string): Promise<Uint8Array>;
32
+ }
33
+ export interface LockableGateway {
34
+ getOwner(contractAddress: string, tokenId: string): Promise<string>;
35
+ isLocked(contractAddress: string, tokenId: string): Promise<boolean>;
36
+ getUnlockChallenge(contractAddress: string, tokenId: string): Promise<string>;
37
+ signUnlockChallenge(challenge: string): Promise<string>;
38
+ isUnlockProofValid(contractAddress: string, tokenId: string, proof: string): Promise<boolean>;
39
+ }
40
+ //# sourceMappingURL=Authority.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Authority.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/Authority.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,aAAa,EAAE,iBAAiB,GAAG,YAAY,CAAC;IAChD,YAAY,EAAE,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AO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9E,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/F"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Authority.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Authority.js","sourceRoot":"","sources":["../../../../../core/src/types/Authority.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import type { IEventChainJSON } from 'eqty-core';
2
+ export interface StoredChainInfo {
3
+ chain: IEventChainJSON;
4
+ state: string;
5
+ package: string;
6
+ uniqueMessageHash: string;
7
+ created: Date;
8
+ latestHash: string;
9
+ keywords: string[];
10
+ }
11
+ //# sourceMappingURL=EventChainStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventChainStore.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/EventChainStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,eAAe,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=EventChainStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventChainStore.js","sourceRoot":"","sources":["../../../../../core/src/types/EventChainStore.ts"],"names":[],"mappings":""}
@@ -0,0 +1,19 @@
1
+ import { Binary } from "eqty-core";
2
+ export interface MessageInfo {
3
+ hash: string;
4
+ recipient: string;
5
+ sender: string | Object;
6
+ size: number;
7
+ timestamp: Date;
8
+ type: string;
9
+ }
10
+ export interface MessageExt extends MessageInfo {
11
+ data: any;
12
+ sender: Object;
13
+ signature: Binary;
14
+ _hash: Binary;
15
+ parsedData: string;
16
+ messageHash?: string | any;
17
+ message?: MessageExt | any;
18
+ }
19
+ //# sourceMappingURL=MessageInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageInfo.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/MessageInfo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAW,SAAQ,WAAW;IAC7C,IAAI,EAAE,GAAG,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAC3B,OAAO,CAAC,EAAE,UAAU,GAAG,GAAG,CAAC;CAC5B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=MessageInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageInfo.js","sourceRoot":"","sources":["../../../../../core/src/types/MessageInfo.ts"],"names":[],"mappings":""}
@@ -0,0 +1,38 @@
1
+ import type TypedDict from './TypedDict';
2
+ export type StateDump = Array<[ArrayLike<number>, ArrayLike<number>]>;
3
+ export interface CosmWasmMessageInfo {
4
+ sender: string;
5
+ funds: object[];
6
+ }
7
+ export interface CosmWasmEvent {
8
+ type: string;
9
+ attributes: TypedDict<string>;
10
+ }
11
+ export interface OwnableRPC {
12
+ init: (id: string, js: string, wasm: Uint8Array) => Promise<any>;
13
+ instantiate: (msg: TypedDict, info: CosmWasmMessageInfo) => Promise<{
14
+ attributes: TypedDict<string>;
15
+ state: StateDump;
16
+ }>;
17
+ execute: (msg: TypedDict, info: CosmWasmMessageInfo, state: StateDump) => Promise<{
18
+ attributes: TypedDict<string>;
19
+ events: Array<CosmWasmEvent>;
20
+ data: string;
21
+ state: StateDump;
22
+ }>;
23
+ externalEvent: (msg: TypedDict, info: TypedDict, state: StateDump) => Promise<{
24
+ attributes: TypedDict<string>;
25
+ events: Array<CosmWasmEvent>;
26
+ data: string;
27
+ state: StateDump;
28
+ }>;
29
+ query: (msg: TypedDict, state: StateDump) => Promise<any>;
30
+ refresh: (state: StateDump) => Promise<void>;
31
+ }
32
+ export interface StateSnapshot {
33
+ eventIndex: number;
34
+ blockHash: string;
35
+ stateDump: StateDump;
36
+ timestamp: Date;
37
+ }
38
+ //# sourceMappingURL=OwnableRuntime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnableRuntime.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/OwnableRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AAEzC,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAEtE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,MAAM,WAAW,UAAU;IACzB,IA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# sourceMappingURL=OwnableRuntime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OwnableRuntime.js","sourceRoot":"","sources":["../../../../../core/src/types/OwnableRuntime.ts"],"names":[],"mappings":""}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @deprecated Relay polling is legacy and will be removed in a future major version.
3
+ * Prefer hub-backed notification flows.
4
+ */
5
+ export interface RelayPollingClient {
6
+ url?: string;
7
+ relay: {
8
+ get(path: string, headers?: Record<string, string>): Promise<any>;
9
+ };
10
+ isAvailable(): Promise<boolean>;
11
+ ensureAuthenticated(): Promise<boolean>;
12
+ getAuthHeaders(): Record<string, string>;
13
+ }
14
+ //# sourceMappingURL=Polling.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Polling.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/Polling.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE;QAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC;IAC7E,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAChC,mBAAmB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Polling.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Polling.js","sourceRoot":"","sources":["../../../../../core/src/types/Polling.ts"],"names":[],"mappings":""}
@@ -0,0 +1,30 @@
1
+ export interface SIWEMessage {
2
+ domain: string;
3
+ address: string;
4
+ statement?: string;
5
+ uri: string;
6
+ version: string;
7
+ chainId: number;
8
+ nonce: string;
9
+ issuedAt: string;
10
+ expirationTime?: string;
11
+ notBefore?: string;
12
+ requestId?: string;
13
+ resources?: string[];
14
+ }
15
+ export interface SIWEAuthResult {
16
+ success: boolean;
17
+ address?: string;
18
+ token?: string;
19
+ expiresIn?: string;
20
+ error?: string;
21
+ }
22
+ export interface SIWEClientDeps {
23
+ fetchFn?: (input: string, init?: RequestInit) => Promise<{
24
+ ok: boolean;
25
+ json(): Promise<any>;
26
+ }>;
27
+ now?: () => Date;
28
+ nonceGenerator?: () => string;
29
+ }
30
+ //# sourceMappingURL=SIWE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SIWE.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/SIWE.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;KAAE,CAAC,CAAC;IAChG,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,MAAM,CAAC;CAC/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=SIWE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SIWE.js","sourceRoot":"","sources":["../../../../../core/src/types/SIWE.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ interface TypedCosmWasmMethod {
2
+ required: string[];
3
+ properties: {
4
+ [methodName: string]: object;
5
+ };
6
+ }
7
+ export interface TypedCosmWasmMsg {
8
+ title: string;
9
+ oneOf: Array<TypedCosmWasmMethod>;
10
+ }
11
+ export {};
12
+ //# sourceMappingURL=TypedCosmWasmMsg.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedCosmWasmMsg.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedCosmWasmMsg.ts"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,UAAU,EAAE;QACV,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;CACH;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;CACnC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TypedCosmWasmMsg.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedCosmWasmMsg.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedCosmWasmMsg.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export default interface TypedDict<T = any> {
2
+ [_: string]: T;
3
+ }
4
+ //# sourceMappingURL=TypedDict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedDict.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedDict.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC,CAAC,GAAG,GAAG;IACxC,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TypedDict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedDict.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedDict.ts"],"names":[],"mappings":""}
@@ -0,0 +1,34 @@
1
+ export interface TypedOwnableInfo {
2
+ owner: string;
3
+ issuer: string;
4
+ ownable_type?: string;
5
+ nft?: NftObject;
6
+ }
7
+ export interface NftObject {
8
+ address: string;
9
+ id: string;
10
+ lock_service?: any;
11
+ network: string;
12
+ }
13
+ export interface TypedMetadata {
14
+ name: string;
15
+ image?: string;
16
+ image_data?: string;
17
+ external_url?: string;
18
+ description?: string;
19
+ background_color?: string;
20
+ animation_url?: string;
21
+ youtube_url?: string;
22
+ }
23
+ export interface TypedOwnable {
24
+ owner: string;
25
+ email?: string;
26
+ name: string;
27
+ description?: string;
28
+ keywords?: string[];
29
+ evmAddress: string;
30
+ network: string;
31
+ image: unknown | null;
32
+ templateId?: string;
33
+ }
34
+ //# sourceMappingURL=TypedOwnableInfo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedOwnableInfo.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedOwnableInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,SAAS,CAAC;CACjB;AAED,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TypedOwnableInfo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedOwnableInfo.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedOwnableInfo.ts"],"names":[],"mappings":""}
@@ -0,0 +1,32 @@
1
+ export interface TypedPackageCapabilities {
2
+ isDynamic: boolean;
3
+ hasMetadata: boolean;
4
+ hasWidgetState: boolean;
5
+ isConsumable: boolean;
6
+ isConsumer: boolean;
7
+ isTransferable: boolean;
8
+ }
9
+ export interface TypedPackage extends TypedPackageCapabilities {
10
+ title: string;
11
+ detail?: unknown;
12
+ name: string;
13
+ description?: string;
14
+ cid: string;
15
+ chain?: unknown;
16
+ isNotLocal?: boolean;
17
+ uniqueMessageHash?: string;
18
+ versions: Array<{
19
+ date: Date;
20
+ cid: string;
21
+ uniqueMessageHash?: string;
22
+ }>;
23
+ keywords?: string[];
24
+ }
25
+ export interface TypedPackageStub {
26
+ title: string;
27
+ name: string;
28
+ description?: string;
29
+ stub: true;
30
+ isNotLocal?: boolean;
31
+ }
32
+ //# sourceMappingURL=TypedPackage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedPackage.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/TypedPackage.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,YAAa,SAAQ,wBAAwB;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACzE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,IAAI,CAAC;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TypedPackage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypedPackage.js","sourceRoot":"","sources":["../../../../../core/src/types/TypedPackage.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export { default as IDBService } from './services/IDB.service';
2
+ export { default as LocalStorageService } from './services/LocalStorage.service';
3
+ export { default as PackageService } from './services/Package.service';
4
+ export { RelayService } from './services/Relay.service';
5
+ export { default as SessionStorageService } from './services/SessionStorage.service';
6
+ export { default as calculateCid } from './utils/calculateCid';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACjF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export { default as IDBService } from './services/IDB.service';
2
+ export { default as LocalStorageService } from './services/LocalStorage.service';
3
+ export { default as PackageService } from './services/Package.service';
4
+ export { RelayService } from './services/Relay.service';
5
+ export { default as SessionStorageService } from './services/SessionStorage.service';
6
+ export { default as calculateCid } from './utils/calculateCid';
7
+ //# sourceMappingURL=index.js.map