@ownables/adapter-viem 0.8.1 → 0.9.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 (121) hide show
  1. package/dist/adapter-viem/src/index.d.ts.map +1 -0
  2. package/dist/adapter-viem/src/index.js.map +1 -0
  3. package/dist/{services → adapter-viem/src/services}/EQTY.service.d.ts +9 -8
  4. package/dist/adapter-viem/src/services/EQTY.service.d.ts.map +1 -0
  5. package/dist/adapter-viem/src/services/EQTY.service.js +515 -0
  6. package/dist/adapter-viem/src/services/EQTY.service.js.map +1 -0
  7. package/dist/{services → adapter-viem/src/services}/MockEQTY.service.d.ts +5 -3
  8. package/dist/adapter-viem/src/services/MockEQTY.service.d.ts.map +1 -0
  9. package/dist/{services → adapter-viem/src/services}/MockEQTY.service.js +14 -10
  10. package/dist/adapter-viem/src/services/MockEQTY.service.js.map +1 -0
  11. package/dist/{types → adapter-viem/src/types}/EQTY.d.ts +9 -0
  12. package/dist/adapter-viem/src/types/EQTY.d.ts.map +1 -0
  13. package/dist/{types → adapter-viem/src/types}/EQTY.js.map +1 -1
  14. package/dist/core/src/index.d.ts +24 -0
  15. package/dist/core/src/index.d.ts.map +1 -0
  16. package/dist/core/src/index.js +23 -0
  17. package/dist/core/src/index.js.map +1 -0
  18. package/dist/core/src/interfaces/core.d.ts +59 -0
  19. package/dist/core/src/interfaces/core.d.ts.map +1 -0
  20. package/dist/core/src/interfaces/core.js +2 -0
  21. package/dist/core/src/interfaces/core.js.map +1 -0
  22. package/dist/core/src/logger.d.ts +3 -0
  23. package/dist/core/src/logger.d.ts.map +1 -0
  24. package/dist/core/src/logger.js +2 -0
  25. package/dist/core/src/logger.js.map +1 -0
  26. package/dist/core/src/services/AnchorValidation.service.d.ts +10 -0
  27. package/dist/core/src/services/AnchorValidation.service.d.ts.map +1 -0
  28. package/dist/core/src/services/AnchorValidation.service.js +115 -0
  29. package/dist/core/src/services/AnchorValidation.service.js.map +1 -0
  30. package/dist/core/src/services/EventChain.service.d.ts +46 -0
  31. package/dist/core/src/services/EventChain.service.d.ts.map +1 -0
  32. package/dist/core/src/services/EventChain.service.js +118 -0
  33. package/dist/core/src/services/EventChain.service.js.map +1 -0
  34. package/dist/core/src/services/Ownable.service.d.ts +97 -0
  35. package/dist/core/src/services/Ownable.service.d.ts.map +1 -0
  36. package/dist/core/src/services/Ownable.service.js +688 -0
  37. package/dist/core/src/services/Ownable.service.js.map +1 -0
  38. package/dist/core/src/services/Polling.service.d.ts +31 -0
  39. package/dist/core/src/services/Polling.service.d.ts.map +1 -0
  40. package/dist/core/src/services/Polling.service.js +109 -0
  41. package/dist/core/src/services/Polling.service.js.map +1 -0
  42. package/dist/core/src/services/Progress.service.d.ts +7 -0
  43. package/dist/core/src/services/Progress.service.d.ts.map +1 -0
  44. package/dist/core/src/services/Progress.service.js +12 -0
  45. package/dist/core/src/services/Progress.service.js.map +1 -0
  46. package/dist/core/src/services/ReplayAuthority.service.d.ts +23 -0
  47. package/dist/core/src/services/ReplayAuthority.service.d.ts.map +1 -0
  48. package/dist/core/src/services/ReplayAuthority.service.js +191 -0
  49. package/dist/core/src/services/ReplayAuthority.service.js.map +1 -0
  50. package/dist/core/src/services/SIWE.service.d.ts +16 -0
  51. package/dist/core/src/services/SIWE.service.d.ts.map +1 -0
  52. package/dist/core/src/services/SIWE.service.js +122 -0
  53. package/dist/core/src/services/SIWE.service.js.map +1 -0
  54. package/dist/core/src/services/StateStoreRecordStore.service.d.ts +13 -0
  55. package/dist/core/src/services/StateStoreRecordStore.service.d.ts.map +1 -0
  56. package/dist/core/src/services/StateStoreRecordStore.service.js +76 -0
  57. package/dist/core/src/services/StateStoreRecordStore.service.js.map +1 -0
  58. package/dist/core/src/services/WorkerRPC.service.d.ts +45 -0
  59. package/dist/core/src/services/WorkerRPC.service.d.ts.map +1 -0
  60. package/dist/core/src/services/WorkerRPC.service.js +292 -0
  61. package/dist/core/src/services/WorkerRPC.service.js.map +1 -0
  62. package/dist/core/src/types/AnchorValidation.d.ts +55 -0
  63. package/dist/core/src/types/AnchorValidation.d.ts.map +1 -0
  64. package/dist/core/src/types/AnchorValidation.js +2 -0
  65. package/dist/core/src/types/AnchorValidation.js.map +1 -0
  66. package/dist/core/src/types/Authority.d.ts +40 -0
  67. package/dist/core/src/types/Authority.d.ts.map +1 -0
  68. package/dist/core/src/types/Authority.js +2 -0
  69. package/dist/core/src/types/Authority.js.map +1 -0
  70. package/dist/core/src/types/EventChainStore.d.ts +12 -0
  71. package/dist/core/src/types/EventChainStore.d.ts.map +1 -0
  72. package/dist/core/src/types/EventChainStore.js +2 -0
  73. package/dist/core/src/types/EventChainStore.js.map +1 -0
  74. package/dist/core/src/types/MessageInfo.d.ts +19 -0
  75. package/dist/core/src/types/MessageInfo.d.ts.map +1 -0
  76. package/dist/core/src/types/MessageInfo.js +2 -0
  77. package/dist/core/src/types/MessageInfo.js.map +1 -0
  78. package/dist/core/src/types/OwnableRuntime.d.ts +79 -0
  79. package/dist/core/src/types/OwnableRuntime.d.ts.map +1 -0
  80. package/dist/core/src/types/OwnableRuntime.js +2 -0
  81. package/dist/core/src/types/OwnableRuntime.js.map +1 -0
  82. package/dist/core/src/types/Polling.d.ts +14 -0
  83. package/dist/core/src/types/Polling.d.ts.map +1 -0
  84. package/dist/core/src/types/Polling.js +2 -0
  85. package/dist/core/src/types/Polling.js.map +1 -0
  86. package/dist/core/src/types/Replay.d.ts +100 -0
  87. package/dist/core/src/types/Replay.d.ts.map +1 -0
  88. package/dist/core/src/types/Replay.js +2 -0
  89. package/dist/core/src/types/Replay.js.map +1 -0
  90. package/dist/core/src/types/SIWE.d.ts +30 -0
  91. package/dist/core/src/types/SIWE.d.ts.map +1 -0
  92. package/dist/core/src/types/SIWE.js +2 -0
  93. package/dist/core/src/types/SIWE.js.map +1 -0
  94. package/dist/core/src/types/TypedCosmWasmMsg.d.ts +12 -0
  95. package/dist/core/src/types/TypedCosmWasmMsg.d.ts.map +1 -0
  96. package/dist/core/src/types/TypedCosmWasmMsg.js +2 -0
  97. package/dist/core/src/types/TypedCosmWasmMsg.js.map +1 -0
  98. package/dist/core/src/types/TypedDict.d.ts +4 -0
  99. package/dist/core/src/types/TypedDict.d.ts.map +1 -0
  100. package/dist/core/src/types/TypedDict.js +2 -0
  101. package/dist/core/src/types/TypedDict.js.map +1 -0
  102. package/dist/core/src/types/TypedOwnableInfo.d.ts +34 -0
  103. package/dist/core/src/types/TypedOwnableInfo.d.ts.map +1 -0
  104. package/dist/core/src/types/TypedOwnableInfo.js +2 -0
  105. package/dist/core/src/types/TypedOwnableInfo.js.map +1 -0
  106. package/dist/core/src/types/TypedPackage.d.ts +39 -0
  107. package/dist/core/src/types/TypedPackage.d.ts.map +1 -0
  108. package/dist/core/src/types/TypedPackage.js +2 -0
  109. package/dist/core/src/types/TypedPackage.js.map +1 -0
  110. package/package.json +7 -5
  111. package/dist/index.d.ts.map +0 -1
  112. package/dist/index.js.map +0 -1
  113. package/dist/services/EQTY.service.d.ts.map +0 -1
  114. package/dist/services/EQTY.service.js +0 -359
  115. package/dist/services/EQTY.service.js.map +0 -1
  116. package/dist/services/MockEQTY.service.d.ts.map +0 -1
  117. package/dist/services/MockEQTY.service.js.map +0 -1
  118. package/dist/types/EQTY.d.ts.map +0 -1
  119. /package/dist/{index.d.ts → adapter-viem/src/index.d.ts} +0 -0
  120. /package/dist/{index.js → adapter-viem/src/index.js} +0 -0
  121. /package/dist/{types → adapter-viem/src/types}/EQTY.js +0 -0
@@ -0,0 +1,13 @@
1
+ import type { RecordStore, BridgedOwnableRecord, NftRef } from '../types/Authority.js';
2
+ import type { StateStore } from '../interfaces/core.js';
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,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA4BxD,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,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAEhF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,G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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,45 @@
1
+ import type TypedDict from '../types/TypedDict.js';
2
+ import type { CosmWasmEvent, CosmWasmMessageInfo, OwnableEvent, OwnableRPC, RuntimePublicEvent, StateDump } from '../types/OwnableRuntime.js';
3
+ export default class WorkerRPC implements OwnableRPC {
4
+ private worker;
5
+ private readonly ownableId;
6
+ private widgetWindow;
7
+ private _queue;
8
+ constructor(id: string);
9
+ private wrapWorkerError;
10
+ initialize(js: string, wasm: Uint8Array): Promise<void>;
11
+ setWidgetWindow(win: unknown | null): void;
12
+ terminate(): void;
13
+ private attributesToDict;
14
+ private decodeEnvelope;
15
+ private workerCall;
16
+ private encodePublicEventRaw;
17
+ instantiate(msg: TypedDict, info: CosmWasmMessageInfo): Promise<{
18
+ attributes: TypedDict<string>;
19
+ state: StateDump;
20
+ }>;
21
+ execute(msg: TypedDict, info: CosmWasmMessageInfo, state: StateDump): Promise<{
22
+ attributes: TypedDict<string>;
23
+ events: Array<CosmWasmEvent>;
24
+ data: string;
25
+ state: StateDump;
26
+ }>;
27
+ register(event: RuntimePublicEvent, info: CosmWasmMessageInfo, state: StateDump): Promise<{
28
+ attributes: TypedDict<string>;
29
+ events: Array<CosmWasmEvent>;
30
+ data: string;
31
+ state: StateDump;
32
+ }>;
33
+ ingest(event: OwnableEvent, info: CosmWasmMessageInfo, state: StateDump): Promise<{
34
+ attributes: TypedDict<string>;
35
+ events: Array<CosmWasmEvent>;
36
+ data: string;
37
+ state: StateDump;
38
+ }>;
39
+ encodePublicEvent(eventType: string, payload: Uint8Array): Promise<Uint8Array>;
40
+ private toExecuteResult;
41
+ private queryRaw;
42
+ query(msg: TypedDict, state: StateDump): Promise<any>;
43
+ refresh(state: StateDump): Promise<void>;
44
+ }
45
+ //# sourceMappingURL=WorkerRPC.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerRPC.service.d.ts","sourceRoot":"","sources":["../../../../../core/src/services/WorkerRPC.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,YAAY,EACZ,UAAU,EAEV,kBAAkB,EAClB,SAAS,EACV,MAAM,4BAA4B,CAAC;AAqBpC,MAAM,CAAC,OAAO,OAAO,SAAU,YAAW,UAAU;IAClD,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,MAAM,CAAmC;gBAErC,EAAE,EAAE,MAAM;IAItB,OAAO,CAAC,eAAe;IA0CjB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC;IA4D7D,eAAe,CAAC,GAAG,E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IAIpF,OAAO,CAAC,eAAe;YAoBT,QAAQ;IAIhB,KAAK,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC;IAKrD,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;CAK/C"}
@@ -0,0 +1,292 @@
1
+ import { decode, encode } from 'cbor-x';
2
+ export default class WorkerRPC {
3
+ worker;
4
+ ownableId;
5
+ widgetWindow = null;
6
+ _queue = Promise.resolve();
7
+ constructor(id) {
8
+ this.ownableId = id;
9
+ }
10
+ wrapWorkerError(context, err) {
11
+ if (err instanceof Error)
12
+ return err;
13
+ if (typeof ErrorEvent !== 'undefined' && err instanceof ErrorEvent) {
14
+ const parts = [
15
+ context,
16
+ err.message || 'worker script error',
17
+ err.filename ? `at ${err.filename}:${err.lineno}:${err.colno}` : '',
18
+ ].filter(Boolean);
19
+ const wrapped = new Error(parts.join(' '));
20
+ wrapped.cause = err;
21
+ return wrapped;
22
+ }
23
+ if (typeof MessageEvent !== 'undefined' && err instanceof MessageEvent) {
24
+ const wrapped = new Error(`${context}: worker message deserialization error`);
25
+ wrapped.cause = err;
26
+ return wrapped;
27
+ }
28
+ if (err instanceof Event) {
29
+ const eventLike = err;
30
+ const details = [
31
+ eventLike?.message,
32
+ eventLike?.filename
33
+ ? `at ${eventLike.filename}:${eventLike.lineno ?? '?'}:${eventLike.colno ?? '?'}`
34
+ : '',
35
+ ]
36
+ .filter((v) => typeof v === 'string' && v.trim() !== '')
37
+ .join(' ');
38
+ const wrapped = new Error(`${context}: worker emitted ${err.type} event${details ? ` (${details})` : ''}`);
39
+ wrapped.cause = err;
40
+ return wrapped;
41
+ }
42
+ const wrapped = new Error(`${context}: ${String(err)}`);
43
+ wrapped.cause = err;
44
+ return wrapped;
45
+ }
46
+ async initialize(js, wasm) {
47
+ return await new Promise((resolve, reject) => {
48
+ const blob = new Blob([js], { type: 'application/javascript' });
49
+ const blobURL = URL.createObjectURL(blob);
50
+ this.worker = new Worker(blobURL, { type: 'module' });
51
+ let settled = false;
52
+ const onMessage = (event) => {
53
+ if (settled)
54
+ return;
55
+ settled = true;
56
+ cleanup();
57
+ if (event.data?.err) {
58
+ const raw = event.data.err;
59
+ if (raw.includes('__wbindgen_placeholder__')) {
60
+ reject(new Error('Ownable package is incompatible with this runtime (wasm-bindgen imports detected). Rebuild and re-import the package with Host ABI v1.'));
61
+ return;
62
+ }
63
+ reject(new Error(`Ownable worker init failed: ${raw}`));
64
+ return;
65
+ }
66
+ if (event.data?.success) {
67
+ resolve();
68
+ return;
69
+ }
70
+ reject(new Error('Ownable worker init failed: invalid init response'));
71
+ };
72
+ const onError = (event) => {
73
+ if (settled)
74
+ return;
75
+ settled = true;
76
+ cleanup();
77
+ reject(this.wrapWorkerError('Ownable worker init failed', event));
78
+ };
79
+ const onMessageError = (event) => {
80
+ if (settled)
81
+ return;
82
+ settled = true;
83
+ cleanup();
84
+ reject(this.wrapWorkerError('Ownable worker init failed', event));
85
+ };
86
+ const cleanup = () => {
87
+ URL.revokeObjectURL(blobURL);
88
+ this.worker.removeEventListener('message', onMessage);
89
+ this.worker.removeEventListener('error', onError);
90
+ this.worker.removeEventListener('messageerror', onMessageError);
91
+ };
92
+ this.worker.addEventListener('message', onMessage);
93
+ this.worker.addEventListener('error', onError);
94
+ this.worker.addEventListener('messageerror', onMessageError);
95
+ this.worker.postMessage({ type: 'init', wasm });
96
+ });
97
+ }
98
+ setWidgetWindow(win) {
99
+ this.widgetWindow = win ?? null;
100
+ }
101
+ terminate() {
102
+ this.worker?.terminate();
103
+ }
104
+ attributesToDict(attributes) {
105
+ return Object.fromEntries(attributes.map((a) => [a.key, a.value]));
106
+ }
107
+ decodeEnvelope(output) {
108
+ const envelope = decode(output instanceof Uint8Array ? output : new Uint8Array(output));
109
+ if (!envelope.success) {
110
+ throw new Error(`Ownable ABI call failed: ${envelope.error_code || 'UNKNOWN'} ${envelope.error_message || ''}`.trim());
111
+ }
112
+ const payload = envelope.payload ?? new Uint8Array();
113
+ return decode(payload);
114
+ }
115
+ workerCall(type, request, state) {
116
+ const call = () => new Promise((resolve, reject) => {
117
+ if (!this.worker) {
118
+ reject(new Error(`Unable to ${type}: not initialized`));
119
+ return;
120
+ }
121
+ let settled = false;
122
+ const onMessage = (event) => {
123
+ if (settled)
124
+ return;
125
+ settled = true;
126
+ cleanup();
127
+ if (event.data?.err) {
128
+ reject(new Error(`Ownable ${type} failed: ${event.data.err}`));
129
+ return;
130
+ }
131
+ if (!event.data?.output) {
132
+ reject(new Error(`Ownable ${type} failed: empty worker output`));
133
+ return;
134
+ }
135
+ try {
136
+ const decoded = this.decodeEnvelope(event.data.output);
137
+ const nextState = decoded.mem?.state_dump ?? state;
138
+ resolve({ response: decoded.result, state: nextState || [] });
139
+ }
140
+ catch (error) {
141
+ reject(error instanceof Error ? error : new Error(String(error)));
142
+ }
143
+ };
144
+ const onError = (event) => {
145
+ if (settled)
146
+ return;
147
+ settled = true;
148
+ cleanup();
149
+ reject(this.wrapWorkerError(`Ownable ${type} failed`, event));
150
+ };
151
+ const onMessageError = (event) => {
152
+ if (settled)
153
+ return;
154
+ settled = true;
155
+ cleanup();
156
+ reject(this.wrapWorkerError(`Ownable ${type} failed`, event));
157
+ };
158
+ const cleanup = () => {
159
+ this.worker.removeEventListener('message', onMessage);
160
+ this.worker.removeEventListener('error', onError);
161
+ this.worker.removeEventListener('messageerror', onMessageError);
162
+ };
163
+ this.worker.addEventListener('message', onMessage);
164
+ this.worker.addEventListener('error', onError);
165
+ this.worker.addEventListener('messageerror', onMessageError);
166
+ const input = encode(request);
167
+ this.worker.postMessage({ type, input });
168
+ });
169
+ const next = this._queue.then(call, call);
170
+ this._queue = next.catch(() => { });
171
+ return next;
172
+ }
173
+ async encodePublicEventRaw(request) {
174
+ const call = () => new Promise((resolve, reject) => {
175
+ if (!this.worker) {
176
+ reject(new Error('Unable to encode_public_event: not initialized'));
177
+ return;
178
+ }
179
+ let settled = false;
180
+ const onMessage = (event) => {
181
+ if (settled)
182
+ return;
183
+ settled = true;
184
+ cleanup();
185
+ if (event.data?.err) {
186
+ reject(new Error(`Ownable encode_public_event failed: ${event.data.err}`));
187
+ return;
188
+ }
189
+ if (!event.data?.output) {
190
+ reject(new Error('Ownable encode_public_event failed: empty worker output'));
191
+ return;
192
+ }
193
+ try {
194
+ const envelope = decode(event.data.output instanceof Uint8Array
195
+ ? event.data.output
196
+ : new Uint8Array(event.data.output));
197
+ if (!envelope.success) {
198
+ reject(new Error(`Ownable ABI call failed: ${envelope.error_code || 'UNKNOWN'} ${envelope.error_message || ''}`.trim()));
199
+ return;
200
+ }
201
+ resolve(envelope.payload ?? new Uint8Array());
202
+ }
203
+ catch (error) {
204
+ reject(error instanceof Error ? error : new Error(String(error)));
205
+ }
206
+ };
207
+ const onError = (event) => {
208
+ if (settled)
209
+ return;
210
+ settled = true;
211
+ cleanup();
212
+ reject(this.wrapWorkerError('Ownable encode_public_event failed', event));
213
+ };
214
+ const onMessageError = (event) => {
215
+ if (settled)
216
+ return;
217
+ settled = true;
218
+ cleanup();
219
+ reject(this.wrapWorkerError('Ownable encode_public_event failed', event));
220
+ };
221
+ const cleanup = () => {
222
+ this.worker.removeEventListener('message', onMessage);
223
+ this.worker.removeEventListener('error', onError);
224
+ this.worker.removeEventListener('messageerror', onMessageError);
225
+ };
226
+ this.worker.addEventListener('message', onMessage);
227
+ this.worker.addEventListener('error', onError);
228
+ this.worker.addEventListener('messageerror', onMessageError);
229
+ const input = encode(request);
230
+ this.worker.postMessage({ type: 'encode_public_event', input });
231
+ });
232
+ const next = this._queue.then(call, call);
233
+ this._queue = next.catch(() => { });
234
+ return next;
235
+ }
236
+ async instantiate(msg, info) {
237
+ const { response, state } = await this.workerCall('instantiate', { msg, info });
238
+ const parsed = decode(response);
239
+ return {
240
+ attributes: this.attributesToDict(parsed.attributes),
241
+ state,
242
+ };
243
+ }
244
+ async execute(msg, info, state) {
245
+ const { response, state: newState } = await this.workerCall('execute', { msg, info, mem: { state_dump: state } }, state);
246
+ return this.toExecuteResult(decode(response), newState);
247
+ }
248
+ async register(event, info, state) {
249
+ const { response, state: newState } = await this.workerCall('register', {
250
+ msg: event,
251
+ info,
252
+ mem: { state_dump: state },
253
+ }, state);
254
+ return this.toExecuteResult(decode(response), newState);
255
+ }
256
+ async ingest(event, info, state) {
257
+ const { response, state: newState } = await this.workerCall('ingest', {
258
+ msg: event,
259
+ info,
260
+ mem: { state_dump: state },
261
+ }, state);
262
+ return this.toExecuteResult(decode(response), newState);
263
+ }
264
+ async encodePublicEvent(eventType, payload) {
265
+ return this.encodePublicEventRaw({ eventType, data: payload });
266
+ }
267
+ toExecuteResult(response, state) {
268
+ return {
269
+ attributes: this.attributesToDict(response.attributes),
270
+ events: (response.events || []).map((e) => ({
271
+ type: e.type,
272
+ attributes: this.attributesToDict(e.attributes),
273
+ })),
274
+ data: response.data ?? '',
275
+ state,
276
+ };
277
+ }
278
+ async queryRaw(msg, state) {
279
+ return (await this.workerCall('query', { msg, mem: { state_dump: state } }, state)).response;
280
+ }
281
+ async query(msg, state) {
282
+ const bytes = await this.queryRaw(msg, state);
283
+ return JSON.parse(new TextDecoder().decode(bytes));
284
+ }
285
+ async refresh(state) {
286
+ if (!this.widgetWindow)
287
+ return;
288
+ const widgetState = await this.query({ get_widget_state: {} }, state);
289
+ this.widgetWindow.postMessage({ ownable_id: this.ownableId, state: widgetState }, '*');
290
+ }
291
+ }
292
+ //# sourceMappingURL=WorkerRPC.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerRPC.service.js","sourceRoot":"","sources":["../../../../../core/src/services/WorkerRPC.service.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAoBxC,MAAM,CAAC,OAAO,OAAO,SAAS;IACpB,MAAM,CAAU;IACP,SAAS,CAAS;IAC3B,YAAY,GAAkB,IAAI,CAAC;IACnC,MAAM,GAAiB,O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{
3
+ key: Binary;
4
+ value: Binary;
5
+ }
6
+ export interface AnchorValidationRecord {
7
+ key: string;
8
+ expectedValue: string;
9
+ value: string;
10
+ transactionHash?: string;
11
+ timestamp?: number;
12
+ blockNumber?: number;
13
+ transactionIndex?: number;
14
+ logIndex?: number;
15
+ verified: boolean;
16
+ source: 'provider' | 'indexed';
17
+ }
18
+ export interface AnchorValidationResult {
19
+ verified: boolean;
20
+ anchors: Record<string, string | undefined>;
21
+ map: Record<string, string>;
22
+ details: Record<string, AnchorValidationRecord>;
23
+ }
24
+ export interface IndexedAnchorRecord {
25
+ key: string;
26
+ value: string;
27
+ transactionHash?: string;
28
+ timestamp?: number;
29
+ blockNumber?: number;
30
+ transactionIndex?: number;
31
+ logIndex?: number;
32
+ }
33
+ export interface AnchorValidationSource {
34
+ validateAnchors(...anchors: Array<Binary | {
35
+ hex: string;
36
+ } | {
37
+ key: Binary | {
38
+ hex: string;
39
+ };
40
+ value: Binary | {
41
+ hex: string;
42
+ };
43
+ }>): Promise<AnchorValidationResult>;
44
+ }
45
+ export type AnchorValidationInput = Binary | {
46
+ hex: string;
47
+ } | {
48
+ key: Binary | {
49
+ hex: string;
50
+ };
51
+ value: Binary | {
52
+ hex: string;
53
+ };
54
+ };
55
+ //# sourceMappingURL=AnchorValidation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnchorValidation.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/AnchorValidation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,WAAW,oBAAoB;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EA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KAAK,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AnchorValidation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnchorValidation.js","sourceRoot":"","sources":["../../../../../core/src/types/AnchorValidation.ts"],"names":[],"mappings":""}
@@ -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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M,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAClD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpE,QAAQ,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACrE,kBAAkB,CAAC,eAAe,EAAE,MAAM,EAAE,OAAO,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,12 @@
1
+ import type { IEventChainJSON } from 'eqty-core';
2
+ export interface StoredChainInfo {
3
+ chain: IEventChainJSON;
4
+ state: string;
5
+ package: string;
6
+ isConsumed?: boolean;
7
+ uniqueMessageHash: string;
8
+ created: Date;
9
+ latestHash: string;
10
+ keywords: string[];
11
+ }
12
+ //# 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,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,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":""}