@arkiv-network/sdk 0.7.0-dev.1 → 0.8.0-advanced.2

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 (237) hide show
  1. package/README.md +71 -16
  2. package/dist/actions/advanced/index.cjs +13 -0
  3. package/dist/actions/advanced/index.d.cts +8 -0
  4. package/dist/actions/advanced/index.d.ts +9 -0
  5. package/dist/actions/advanced/index.js +9 -0
  6. package/dist/advanced-8ZPTmmaN.js +598 -0
  7. package/dist/advanced-8ZPTmmaN.js.map +1 -0
  8. package/dist/advanced-fPImL6lW.cjs +656 -0
  9. package/dist/arkivTransactions-D74gERHG.d.cts +571 -0
  10. package/dist/arkivTransactions-D74gERHG.d.cts.map +1 -0
  11. package/dist/arkivTransactions-NtGD6uk5.d.ts +571 -0
  12. package/dist/arkivTransactions-NtGD6uk5.d.ts.map +1 -0
  13. package/dist/attr/index.cjs +35 -0
  14. package/dist/attr/index.d.cts +2 -0
  15. package/dist/attr/index.d.ts +3 -0
  16. package/dist/attr/index.js +4 -0
  17. package/dist/attributes-BhY5DwJp.js +809 -0
  18. package/dist/attributes-BhY5DwJp.js.map +1 -0
  19. package/dist/attributes-Df9IsCVs.cjs +1029 -0
  20. package/dist/chains/index.cjs +2 -3
  21. package/dist/chains/index.d.cts +22 -60
  22. package/dist/chains/index.d.cts.map +1 -1
  23. package/dist/chains/index.d.ts +22 -60
  24. package/dist/chains/index.d.ts.map +1 -1
  25. package/dist/chains/index.js +2 -2
  26. package/dist/chains-BJrZs6sG.js +57 -0
  27. package/dist/chains-BJrZs6sG.js.map +1 -0
  28. package/dist/chains-BYRTTipa.cjs +73 -0
  29. package/dist/codec-Car3KkFF.d.ts +102 -0
  30. package/dist/codec-Car3KkFF.d.ts.map +1 -0
  31. package/dist/entity/index.cjs +20 -0
  32. package/dist/entity/index.d.cts +4 -0
  33. package/dist/entity/index.d.ts +5 -0
  34. package/dist/entity/index.js +7 -0
  35. package/dist/entity-B00Li04j.cjs +71 -0
  36. package/dist/entity-B7G8q_Eo.cjs +0 -0
  37. package/dist/entity-BYQR1uoe.js +67 -0
  38. package/dist/entity-BYQR1uoe.js.map +1 -0
  39. package/dist/entity-CD_qFF2M.js +0 -0
  40. package/dist/errors-BVbjKVMN.cjs +56 -0
  41. package/dist/errors-LTe7bOYS.js +33 -0
  42. package/dist/errors-LTe7bOYS.js.map +1 -0
  43. package/dist/expiry-BELY2Kpw.cjs +135 -0
  44. package/dist/expiry-BjpxZZQU.js +95 -0
  45. package/dist/expiry-BjpxZZQU.js.map +1 -0
  46. package/dist/expiry-DRV29F1r.d.cts +79 -0
  47. package/dist/expiry-DRV29F1r.d.cts.map +1 -0
  48. package/dist/expiry-nDbCgZX4.d.ts +79 -0
  49. package/dist/expiry-nDbCgZX4.d.ts.map +1 -0
  50. package/dist/flags-5dTNRnow.d.ts +41 -0
  51. package/dist/flags-5dTNRnow.d.ts.map +1 -0
  52. package/dist/flags-CRjPpoh3.d.cts +41 -0
  53. package/dist/flags-CRjPpoh3.d.cts.map +1 -0
  54. package/dist/flags-DFBs2J94.js +33 -0
  55. package/dist/flags-DFBs2J94.js.map +1 -0
  56. package/dist/flags-kr276q6i.cjs +43 -0
  57. package/dist/index-B5j76711.d.ts +184 -0
  58. package/dist/index-B5j76711.d.ts.map +1 -0
  59. package/dist/index-BF7Mq9Is.d.cts +280 -0
  60. package/dist/index-BF7Mq9Is.d.cts.map +1 -0
  61. package/dist/index-CA4V7Pdh.d.cts +167 -0
  62. package/dist/index-CA4V7Pdh.d.cts.map +1 -0
  63. package/dist/index-CV5zCdpa.d.cts +417 -0
  64. package/dist/index-CV5zCdpa.d.cts.map +1 -0
  65. package/dist/index-DHDud2hC.d.ts +280 -0
  66. package/dist/index-DHDud2hC.d.ts.map +1 -0
  67. package/dist/index-DvYvrkdk.d.ts +320 -0
  68. package/dist/index-DvYvrkdk.d.ts.map +1 -0
  69. package/dist/index-EeUO0nnJ.d.cts +184 -0
  70. package/dist/index-EeUO0nnJ.d.cts.map +1 -0
  71. package/dist/index-fX_XyqLp.d.ts +167 -0
  72. package/dist/index-fX_XyqLp.d.ts.map +1 -0
  73. package/dist/index.cjs +411 -405
  74. package/dist/index.d.cts +360 -209
  75. package/dist/index.d.cts.map +1 -1
  76. package/dist/index.d.ts +361 -209
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +342 -387
  79. package/dist/index.js.map +1 -1
  80. package/dist/key-D1Bh7MF0.js +70 -0
  81. package/dist/key-D1Bh7MF0.js.map +1 -0
  82. package/dist/key-WKhXnXuU.cjs +98 -0
  83. package/dist/logger-CVpvU8ik.js +153 -0
  84. package/dist/logger-CVpvU8ik.js.map +1 -0
  85. package/dist/logger-Cr15lPAQ.cjs +188 -0
  86. package/dist/payload-BNoud2KZ.d.cts +94 -0
  87. package/dist/payload-BNoud2KZ.d.cts.map +1 -0
  88. package/dist/payload-Bz6651ax.js +67 -0
  89. package/dist/payload-Bz6651ax.js.map +1 -0
  90. package/dist/payload-CcUj85ys.d.ts +94 -0
  91. package/dist/payload-CcUj85ys.d.ts.map +1 -0
  92. package/dist/payload-KC14SDlN.cjs +83 -0
  93. package/dist/query/index.cjs +26 -150
  94. package/dist/query/index.d.cts +5 -3
  95. package/dist/query/index.d.ts +6 -3
  96. package/dist/query/index.js +8 -138
  97. package/dist/queryBuilder-DM6AWCBa.js +820 -0
  98. package/dist/queryBuilder-DM6AWCBa.js.map +1 -0
  99. package/dist/queryBuilder-DbUMEZln.cjs +944 -0
  100. package/dist/selection-C4UhsMOO.d.ts +434 -0
  101. package/dist/selection-C4UhsMOO.d.ts.map +1 -0
  102. package/dist/selection-DPg0uyJf.d.cts +433 -0
  103. package/dist/selection-DPg0uyJf.d.cts.map +1 -0
  104. package/dist/types/index.cjs +3 -3
  105. package/dist/types/index.d.cts +7 -2
  106. package/dist/types/index.d.ts +8 -2
  107. package/dist/types/index.js +3 -3
  108. package/dist/types-Bu_ZwMbZ.js +0 -0
  109. package/dist/types-NRqymi6S.cjs +0 -0
  110. package/dist/utils/index.cjs +4 -17
  111. package/dist/utils/index.d.cts +3 -17
  112. package/dist/utils/index.d.ts +3 -17
  113. package/dist/utils/index.js +4 -18
  114. package/package.json +26 -5
  115. package/src/actions/advanced/advanced.test.ts +258 -0
  116. package/src/actions/advanced/buildMutation.ts +104 -0
  117. package/src/actions/advanced/getMutationResult.ts +112 -0
  118. package/src/actions/advanced/index.ts +21 -0
  119. package/src/actions/advanced/pingTransaction.ts +43 -0
  120. package/src/actions/advanced/sendMutation.ts +59 -0
  121. package/src/actions/public/getEntity.ts +27 -43
  122. package/src/actions/public/getEntityNonce.ts +30 -0
  123. package/src/actions/public/predictEntityKeys.test.ts +143 -0
  124. package/src/actions/public/predictEntityKeys.ts +138 -0
  125. package/src/actions/public/query.ts +35 -67
  126. package/src/actions/public/watchEntityEvents.test.ts +414 -0
  127. package/src/actions/public/watchEntityEvents.ts +225 -0
  128. package/src/actions/wallet/changeOwnership.ts +2 -2
  129. package/src/actions/wallet/createEntity.ts +99 -24
  130. package/src/actions/wallet/extendEntity.ts +37 -13
  131. package/src/actions/wallet/mutateEntities.test.ts +76 -0
  132. package/src/actions/wallet/mutateEntities.ts +16 -33
  133. package/src/actions/wallet/patchEntity.ts +90 -0
  134. package/src/attr/attributes.test.ts +120 -0
  135. package/src/attr/attributes.ts +190 -0
  136. package/src/attr/codec.test.ts +162 -0
  137. package/src/attr/codec.ts +220 -0
  138. package/src/attr/decimal.ts +86 -0
  139. package/src/attr/errors.ts +145 -0
  140. package/src/attr/index.ts +50 -0
  141. package/src/attr/names.ts +106 -0
  142. package/src/attr/types.ts +150 -0
  143. package/src/attr/values.test.ts +271 -0
  144. package/src/attr/values.ts +502 -0
  145. package/src/chains/cheesecake.ts +22 -0
  146. package/src/chains/index.ts +1 -2
  147. package/src/clients/createPublicClient.test.ts +3 -5
  148. package/src/clients/createPublicClient.ts +5 -4
  149. package/src/clients/createWalletClient.test.ts +2 -2
  150. package/src/clients/createWalletClient.ts +13 -7
  151. package/src/clients/decorators/arkivAdvanced.ts +144 -0
  152. package/src/clients/decorators/arkivPublic.ts +172 -139
  153. package/src/clients/decorators/arkivWallet.ts +101 -94
  154. package/src/entity/create.test.ts +184 -0
  155. package/src/entity/errors.ts +38 -0
  156. package/src/entity/events.ts +16 -0
  157. package/src/entity/expiry.test.ts +195 -0
  158. package/src/entity/expiry.ts +181 -0
  159. package/src/entity/flags.ts +65 -0
  160. package/src/entity/index.ts +15 -0
  161. package/src/entity/key.ts +68 -0
  162. package/src/entity/operations.ts +134 -0
  163. package/src/entity/params.ts +15 -0
  164. package/src/errors.ts +26 -49
  165. package/src/index.ts +19 -0
  166. package/src/query/engine.ts +68 -137
  167. package/src/query/errors.ts +151 -0
  168. package/src/query/expression.test.ts +286 -0
  169. package/src/query/expression.ts +493 -0
  170. package/src/query/index.ts +40 -4
  171. package/src/query/injection.test.ts +151 -0
  172. package/src/query/queryBuilder.test.ts +342 -637
  173. package/src/query/queryBuilder.ts +133 -359
  174. package/src/query/queryResult.ts +54 -51
  175. package/src/query/selection.test.ts +48 -98
  176. package/src/query/selection.ts +77 -65
  177. package/src/types/entity.test.ts +44 -155
  178. package/src/types/entity.ts +60 -52
  179. package/src/types/events.ts +59 -16
  180. package/src/types/index.ts +20 -17
  181. package/src/types/rpcSchema.ts +69 -37
  182. package/src/utils/arkivTransactions.test.ts +600 -155
  183. package/src/utils/arkivTransactions.ts +350 -219
  184. package/src/utils/chains.test.ts +21 -24
  185. package/src/utils/compression.ts +1 -1
  186. package/src/utils/entities.test.ts +62 -0
  187. package/src/utils/entities.ts +109 -37
  188. package/src/utils/expirationTime.ts +114 -10
  189. package/src/utils/logger.ts +2 -2
  190. package/src/utils/revert.test.ts +99 -0
  191. package/src/utils/revert.ts +145 -0
  192. package/dist/chains-BifaY04V.cjs +0 -108
  193. package/dist/chains-CrtkVbBh.js +0 -86
  194. package/dist/chains-CrtkVbBh.js.map +0 -1
  195. package/dist/consts-Bz0LZQZY.js +0 -7
  196. package/dist/consts-Bz0LZQZY.js.map +0 -1
  197. package/dist/consts-CxT1-RXU.cjs +0 -18
  198. package/dist/entity-BhSXaB23.cjs +0 -81
  199. package/dist/entity-CN41IOrq.d.cts +0 -401
  200. package/dist/entity-CN41IOrq.d.cts.map +0 -1
  201. package/dist/entity-DGfVyB-a.js +0 -71
  202. package/dist/entity-DGfVyB-a.js.map +0 -1
  203. package/dist/entity-NnEVlePN.d.ts +0 -401
  204. package/dist/entity-NnEVlePN.d.ts.map +0 -1
  205. package/dist/index-ClkpS6s_.d.ts +0 -481
  206. package/dist/index-ClkpS6s_.d.ts.map +0 -1
  207. package/dist/index-w4qop0Pe.d.cts +0 -481
  208. package/dist/index-w4qop0Pe.d.cts.map +0 -1
  209. package/dist/payload-BpNUPOnY.js +0 -13
  210. package/dist/payload-BpNUPOnY.js.map +0 -1
  211. package/dist/payload-C2KHOUoj.d.ts +0 -6
  212. package/dist/payload-C2KHOUoj.d.ts.map +0 -1
  213. package/dist/payload-CJN8fTvX.d.cts +0 -6
  214. package/dist/payload-CJN8fTvX.d.cts.map +0 -1
  215. package/dist/payload-D8YLKcJj.cjs +0 -23
  216. package/dist/query/index.js.map +0 -1
  217. package/dist/queryBuilder-BE_XhLLa.js +0 -735
  218. package/dist/queryBuilder-BE_XhLLa.js.map +0 -1
  219. package/dist/queryBuilder-J37buGCi.cjs +0 -865
  220. package/dist/utils/index.d.cts.map +0 -1
  221. package/dist/utils/index.d.ts.map +0 -1
  222. package/dist/utils/index.js.map +0 -1
  223. package/src/actions/public/buildQuery.ts +0 -10
  224. package/src/actions/public/subscribeEntityEvents.ts +0 -93
  225. package/src/actions/wallet/updateEntity.ts +0 -59
  226. package/src/chains/braga.ts +0 -26
  227. package/src/chains/kaolin.ts +0 -29
  228. package/src/query/engine.test.ts +0 -571
  229. package/src/query/predicate.test.ts +0 -461
  230. package/src/query/predicate.ts +0 -144
  231. package/src/query/queryResult.test.ts +0 -270
  232. package/src/query/selectQueryBuilder.test.ts +0 -213
  233. package/src/types/attributes.ts +0 -28
  234. package/src/utils/validation.test.ts +0 -106
  235. package/src/utils/validation.ts +0 -80
  236. /package/dist/{types-Ci4BRClw.js → attr-DlmErkvR.cjs} +0 -0
  237. /package/dist/{types-a8gm_IaQ.cjs → attr-GcQKatub.js} +0 -0
@@ -1,5 +1,4 @@
1
- const require_chains = require('../chains-BifaY04V.cjs');
1
+ const require_chains = require('../chains-BYRTTipa.cjs');
2
2
 
3
- exports.braga = require_chains.braga;
4
- exports.kaolin = require_chains.kaolin;
3
+ exports.cheesecake = require_chains.cheesecake;
5
4
  exports.localhost = require_chains.localhost;
@@ -1,60 +1,22 @@
1
1
  import * as viem8 from "viem";
2
2
 
3
- //#region src/chains/braga.d.ts
4
- declare const braga: {
5
- blockExplorers: {
6
- readonly default: {
7
- readonly name: "Braga Arkiv Explorer";
8
- readonly url: "https://explorer.braga.hoodi.arkiv.network";
9
- readonly apiUrl: "https://explorer.braga.hoodi.arkiv.network/api";
10
- };
11
- };
12
- blockTime?: number | undefined | undefined;
13
- contracts?: {
14
- [x: string]: viem8.ChainContract | {
15
- [sourceId: number]: viem8.ChainContract | undefined;
16
- } | undefined;
17
- ensRegistry?: viem8.ChainContract | undefined;
18
- ensUniversalResolver?: viem8.ChainContract | undefined;
19
- multicall3?: viem8.ChainContract | undefined;
20
- erc6492Verifier?: viem8.ChainContract | undefined;
21
- } | undefined;
22
- ensTlds?: readonly string[] | undefined;
23
- id: 60138453102;
24
- name: "Braga";
25
- nativeCurrency: {
26
- readonly name: "Golem";
27
- readonly symbol: "GLM";
28
- readonly decimals: 18;
29
- };
30
- experimental_preconfirmationTime?: number | undefined | undefined;
31
- rpcUrls: {
32
- readonly default: {
33
- readonly http: readonly ["https://braga.hoodi.arkiv.network/rpc"];
34
- readonly webSocket: readonly ["wss://braga.hoodi.arkiv.network/rpc/ws"];
35
- };
36
- };
37
- sourceId?: number | undefined | undefined;
38
- testnet: true;
39
- custom?: Record<string, unknown> | undefined;
40
- fees?: viem8.ChainFees<undefined> | undefined;
41
- formatters?: undefined;
42
- serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
43
- readonly network: "braga";
44
- };
45
- //#endregion
46
- //#region src/chains/kaolin.d.ts
3
+ //#region src/chains/cheesecake.d.ts
47
4
  /**
48
- * @deprecated The kaolin network is getting removed on may 15th 2026. Migration guide: https://docs.arkiv.network/networks/migrate-from-kaolin/
5
+ * Cheesecake is Arkiv's testnet.
49
6
  */
50
- declare const kaolin: {
51
- blockExplorers: {
52
- readonly default: {
53
- readonly name: "Kaolin Arkiv Explorer";
54
- readonly url: "https://explorer.kaolin.hoodi.arkiv.network";
55
- readonly apiUrl: "https://explorer.kaolin.hoodi.arkiv.network/api";
7
+ declare const cheesecake: {
8
+ blockExplorers?: {
9
+ [key: string]: {
10
+ name: string;
11
+ url: string;
12
+ apiUrl?: string | undefined;
56
13
  };
57
- };
14
+ default: {
15
+ name: string;
16
+ url: string;
17
+ apiUrl?: string | undefined;
18
+ };
19
+ } | undefined | undefined;
58
20
  blockTime?: number | undefined | undefined;
59
21
  contracts?: {
60
22
  [x: string]: viem8.ChainContract | {
@@ -66,18 +28,18 @@ declare const kaolin: {
66
28
  erc6492Verifier?: viem8.ChainContract | undefined;
67
29
  } | undefined;
68
30
  ensTlds?: readonly string[] | undefined;
69
- id: 60138453025;
70
- name: "Kaolin";
31
+ id: 7733102;
32
+ name: "Cheesecake";
71
33
  nativeCurrency: {
72
- readonly name: "Ethereum";
73
- readonly symbol: "ETH";
34
+ readonly name: "Golem";
35
+ readonly symbol: "GLM";
74
36
  readonly decimals: 18;
75
37
  };
76
38
  experimental_preconfirmationTime?: number | undefined | undefined;
77
39
  rpcUrls: {
78
40
  readonly default: {
79
- readonly http: readonly ["https://kaolin.hoodi.arkiv.network/rpc"];
80
- readonly webSocket: readonly ["wss://kaolin.hoodi.arkiv.network/rpc/ws"];
41
+ readonly http: readonly ["https://rpc.cheesecake.db-chain.devnet.gobas.me"];
42
+ readonly webSocket: readonly ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"];
81
43
  };
82
44
  };
83
45
  sourceId?: number | undefined | undefined;
@@ -86,7 +48,7 @@ declare const kaolin: {
86
48
  fees?: viem8.ChainFees<undefined> | undefined;
87
49
  formatters?: undefined;
88
50
  serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
89
- readonly network: "kaolin";
51
+ readonly network: "cheesecake";
90
52
  };
91
53
  //#endregion
92
54
  //#region src/chains/localhost.d.ts
@@ -135,5 +97,5 @@ declare const localhost: {
135
97
  serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
136
98
  };
137
99
  //#endregion
138
- export { braga, kaolin, localhost };
100
+ export { cheesecake, localhost };
139
101
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/chains/braga.ts","../../src/chains/kaolin.ts","../../src/chains/localhost.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;MAuBX,SAAA,IAAA,EAAA,sBAAA;MAAA,SAAA,GAAA,EAAA,4CAAA;;;;;;iBAAA,KAAA,CAAA,aAAA;;;;;;;;ECpBW,OAAA,CAAA,EAuBX,SAAA,MAAA,EAAA,GAAA,SAAA;EAAA,EAAA,EAAA,WAAA;;;;;;;;;;;;;;EC1BW,QAAA,CAAA,EAAA,MAWX,GAAA,SAAA,GAAA,SAAA;EAAA,OAAA,EAAA,IAAA;;;;;;;;;;;;AFXW,cCGA,MDoBX,EAAA;EAAA,cAAA,EAAA;;;;;;;;;iBCGA,KAAA,CAAA,aAAA;;;;;IAvBW,UAuBX,CAAA,wBAAA,SAAA;IAAA,eAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;MC1BW,SAWX,SAAA,EAAA,SAAA,CAAA,yCAAA,CAAA;IAAA,CAAA;;;;;;;;;;;;cAXW;;;MFuBX,IAAA,EAAA,MAAA;MAAA,GAAA,EAAA,MAAA;;;;;;;;;;;iBEZA,KAAA,CAAA,aAAA;;;IDRW,WAuBX,CAAA,wBAAA,SAAA;IAAA,oBAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;IC1BW,SAWX,OAAA,EAAA;MAAA,SAAA,IAAA,EAAA,SAAA,CAAA,uBAAA,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/chains/cheesecake.ts","../../src/chains/localhost.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,UAgBX,EAAA;EAAA,cAAA,CAAA,EAAA;;;;;;;;;;;;;;ICnBW,CAAA,CAAA,EAAA,MAWX,CAAA,EDQA,KAAA,CAAA,aAAA,GCRA;MAAA,CAAA,QAAA,EAAA,MAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAXW;;;MDGA,IAAA,EAgBX,MAAA;MAAA,GAAA,EAAA,MAAA;;;;;;;;;;;iBCRA,KAAA,CAAA,aAAA;;;IAXW,WAWX,CAAA,wBAAA,SAAA;IAAA,oBAAA,CAAA,wBAAA,SAAA"}
@@ -1,60 +1,22 @@
1
1
  import * as viem8 from "viem";
2
2
 
3
- //#region src/chains/braga.d.ts
4
- declare const braga: {
5
- blockExplorers: {
6
- readonly default: {
7
- readonly name: "Braga Arkiv Explorer";
8
- readonly url: "https://explorer.braga.hoodi.arkiv.network";
9
- readonly apiUrl: "https://explorer.braga.hoodi.arkiv.network/api";
10
- };
11
- };
12
- blockTime?: number | undefined | undefined;
13
- contracts?: {
14
- [x: string]: viem8.ChainContract | {
15
- [sourceId: number]: viem8.ChainContract | undefined;
16
- } | undefined;
17
- ensRegistry?: viem8.ChainContract | undefined;
18
- ensUniversalResolver?: viem8.ChainContract | undefined;
19
- multicall3?: viem8.ChainContract | undefined;
20
- erc6492Verifier?: viem8.ChainContract | undefined;
21
- } | undefined;
22
- ensTlds?: readonly string[] | undefined;
23
- id: 60138453102;
24
- name: "Braga";
25
- nativeCurrency: {
26
- readonly name: "Golem";
27
- readonly symbol: "GLM";
28
- readonly decimals: 18;
29
- };
30
- experimental_preconfirmationTime?: number | undefined | undefined;
31
- rpcUrls: {
32
- readonly default: {
33
- readonly http: readonly ["https://braga.hoodi.arkiv.network/rpc"];
34
- readonly webSocket: readonly ["wss://braga.hoodi.arkiv.network/rpc/ws"];
35
- };
36
- };
37
- sourceId?: number | undefined | undefined;
38
- testnet: true;
39
- custom?: Record<string, unknown> | undefined;
40
- fees?: viem8.ChainFees<undefined> | undefined;
41
- formatters?: undefined;
42
- serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
43
- readonly network: "braga";
44
- };
45
- //#endregion
46
- //#region src/chains/kaolin.d.ts
3
+ //#region src/chains/cheesecake.d.ts
47
4
  /**
48
- * @deprecated The kaolin network is getting removed on may 15th 2026. Migration guide: https://docs.arkiv.network/networks/migrate-from-kaolin/
5
+ * Cheesecake is Arkiv's testnet.
49
6
  */
50
- declare const kaolin: {
51
- blockExplorers: {
52
- readonly default: {
53
- readonly name: "Kaolin Arkiv Explorer";
54
- readonly url: "https://explorer.kaolin.hoodi.arkiv.network";
55
- readonly apiUrl: "https://explorer.kaolin.hoodi.arkiv.network/api";
7
+ declare const cheesecake: {
8
+ blockExplorers?: {
9
+ [key: string]: {
10
+ name: string;
11
+ url: string;
12
+ apiUrl?: string | undefined;
56
13
  };
57
- };
14
+ default: {
15
+ name: string;
16
+ url: string;
17
+ apiUrl?: string | undefined;
18
+ };
19
+ } | undefined | undefined;
58
20
  blockTime?: number | undefined | undefined;
59
21
  contracts?: {
60
22
  [x: string]: viem8.ChainContract | {
@@ -66,18 +28,18 @@ declare const kaolin: {
66
28
  erc6492Verifier?: viem8.ChainContract | undefined;
67
29
  } | undefined;
68
30
  ensTlds?: readonly string[] | undefined;
69
- id: 60138453025;
70
- name: "Kaolin";
31
+ id: 7733102;
32
+ name: "Cheesecake";
71
33
  nativeCurrency: {
72
- readonly name: "Ethereum";
73
- readonly symbol: "ETH";
34
+ readonly name: "Golem";
35
+ readonly symbol: "GLM";
74
36
  readonly decimals: 18;
75
37
  };
76
38
  experimental_preconfirmationTime?: number | undefined | undefined;
77
39
  rpcUrls: {
78
40
  readonly default: {
79
- readonly http: readonly ["https://kaolin.hoodi.arkiv.network/rpc"];
80
- readonly webSocket: readonly ["wss://kaolin.hoodi.arkiv.network/rpc/ws"];
41
+ readonly http: readonly ["https://rpc.cheesecake.db-chain.devnet.gobas.me"];
42
+ readonly webSocket: readonly ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"];
81
43
  };
82
44
  };
83
45
  sourceId?: number | undefined | undefined;
@@ -86,7 +48,7 @@ declare const kaolin: {
86
48
  fees?: viem8.ChainFees<undefined> | undefined;
87
49
  formatters?: undefined;
88
50
  serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
89
- readonly network: "kaolin";
51
+ readonly network: "cheesecake";
90
52
  };
91
53
  //#endregion
92
54
  //#region src/chains/localhost.d.ts
@@ -135,5 +97,5 @@ declare const localhost: {
135
97
  serializers?: viem8.ChainSerializers<undefined, viem8.TransactionSerializable> | undefined;
136
98
  };
137
99
  //#endregion
138
- export { braga, kaolin, localhost };
100
+ export { cheesecake, localhost };
139
101
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/chains/braga.ts","../../src/chains/kaolin.ts","../../src/chains/localhost.ts"],"sourcesContent":[],"mappings":";;;cAEa;;;MAuBX,SAAA,IAAA,EAAA,sBAAA;MAAA,SAAA,GAAA,EAAA,4CAAA;;;;;;iBAAA,KAAA,CAAA,aAAA;;;;;;;;ECpBW,OAAA,CAAA,EAuBX,SAAA,MAAA,EAAA,GAAA,SAAA;EAAA,EAAA,EAAA,WAAA;;;;;;;;;;;;;;EC1BW,QAAA,CAAA,EAAA,MAWX,GAAA,SAAA,GAAA,SAAA;EAAA,OAAA,EAAA,IAAA;;;;;;;;;;;;AFXW,cCGA,MDoBX,EAAA;EAAA,cAAA,EAAA;;;;;;;;;iBCGA,KAAA,CAAA,aAAA;;;;;IAvBW,UAuBX,CAAA,wBAAA,SAAA;IAAA,eAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;MC1BW,SAWX,SAAA,EAAA,SAAA,CAAA,yCAAA,CAAA;IAAA,CAAA;;;;;;;;;;;;cAXW;;;MFuBX,IAAA,EAAA,MAAA;MAAA,GAAA,EAAA,MAAA;;;;;;;;;;;iBEZA,KAAA,CAAA,aAAA;;;IDRW,WAuBX,CAAA,wBAAA,SAAA;IAAA,oBAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;IC1BW,SAWX,OAAA,EAAA;MAAA,SAAA,IAAA,EAAA,SAAA,CAAA,uBAAA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/chains/cheesecake.ts","../../src/chains/localhost.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,UAgBX,EAAA;EAAA,cAAA,CAAA,EAAA;;;;;;;;;;;;;;ICnBW,CAAA,CAAA,EAAA,MAWX,CAAA,EDQA,KAAA,CAAA,aAAA,GCRA;MAAA,CAAA,QAAA,EAAA,MAAA,CAAA,wBAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAXW;;;MDGA,IAAA,EAgBX,MAAA;MAAA,GAAA,EAAA,MAAA;;;;;;;;;;;iBCRA,KAAA,CAAA,aAAA;;;IAXW,WAWX,CAAA,wBAAA,SAAA;IAAA,oBAAA,CAAA,wBAAA,SAAA"}
@@ -1,3 +1,3 @@
1
- import { i as braga, n as localhost, r as kaolin } from "../chains-CrtkVbBh.js";
1
+ import { n as localhost, r as cheesecake } from "../chains-BJrZs6sG.js";
2
2
 
3
- export { braga, kaolin, localhost };
3
+ export { cheesecake, localhost };
@@ -0,0 +1,57 @@
1
+ import { defineChain } from "viem";
2
+
3
+ //#region rolldown:runtime
4
+ var __defProp = Object.defineProperty;
5
+ var __export = (all) => {
6
+ let target = {};
7
+ for (var name in all) __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ return target;
12
+ };
13
+
14
+ //#endregion
15
+ //#region src/chains/cheesecake.ts
16
+ /**
17
+ * Cheesecake is Arkiv's testnet.
18
+ */
19
+ const cheesecake = defineChain({
20
+ id: 7733102,
21
+ name: "Cheesecake",
22
+ network: "cheesecake",
23
+ nativeCurrency: {
24
+ name: "Golem",
25
+ symbol: "GLM",
26
+ decimals: 18
27
+ },
28
+ rpcUrls: { default: {
29
+ http: ["https://rpc.cheesecake.db-chain.devnet.gobas.me"],
30
+ webSocket: ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"]
31
+ } },
32
+ testnet: true
33
+ });
34
+
35
+ //#endregion
36
+ //#region src/chains/localhost.ts
37
+ const localhost = defineChain({
38
+ id: 1337,
39
+ name: "Localhost",
40
+ nativeCurrency: {
41
+ decimals: 18,
42
+ name: "Ether",
43
+ symbol: "ETH"
44
+ },
45
+ rpcUrls: { default: { http: ["http://127.0.0.1:8545"] } }
46
+ });
47
+
48
+ //#endregion
49
+ //#region src/chains/index.ts
50
+ var chains_exports = /* @__PURE__ */ __export({
51
+ cheesecake: () => cheesecake,
52
+ localhost: () => localhost
53
+ });
54
+
55
+ //#endregion
56
+ export { localhost as n, cheesecake as r, chains_exports as t };
57
+ //# sourceMappingURL=chains-BJrZs6sG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chains-BJrZs6sG.js","names":[],"sources":["../src/chains/cheesecake.ts","../src/chains/localhost.ts","../src/chains/index.ts"],"sourcesContent":["import { defineChain } from \"viem\"\n\n/**\n * Cheesecake is Arkiv's testnet.\n */\nexport const cheesecake = defineChain({\n id: 7733102,\n name: \"Cheesecake\",\n network: \"cheesecake\",\n nativeCurrency: {\n name: \"Golem\",\n symbol: \"GLM\",\n decimals: 18,\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.cheesecake.db-chain.devnet.gobas.me\"],\n webSocket: [\"wss://rpc.cheesecake.db-chain.devnet.gobas.me\"],\n },\n },\n testnet: true,\n})\n","import { defineChain } from \"viem\"\n\nexport const localhost = defineChain({\n id: 1337,\n name: \"Localhost\",\n nativeCurrency: {\n decimals: 18,\n name: \"Ether\",\n symbol: \"ETH\",\n },\n rpcUrls: {\n default: { http: [\"http://127.0.0.1:8545\"] },\n },\n})\n","export { cheesecake } from \"./cheesecake\"\nexport { localhost } from \"./localhost\"\n"],"mappings":";;;;;;;;;;;;;;;;;;AAKA,MAAa,aAAa,YAAY;CACpC,IAAI;CACJ,MAAM;CACN,SAAS;CACT,gBAAgB;EACd,MAAM;EACN,QAAQ;EACR,UAAU;EACX;CACD,SAAS,EACP,SAAS;EACP,MAAM,CAAC,kDAAkD;EACzD,WAAW,CAAC,gDAAgD;EAC7D,EACF;CACD,SAAS;CACV,CAAC;;;;ACnBF,MAAa,YAAY,YAAY;CACnC,IAAI;CACJ,MAAM;CACN,gBAAgB;EACd,UAAU;EACV,MAAM;EACN,QAAQ;EACT;CACD,SAAS,EACP,SAAS,EAAE,MAAM,CAAC,wBAAwB,EAAE,EAC7C;CACF,CAAC"}
@@ -0,0 +1,73 @@
1
+ //#region rolldown:runtime
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (all) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ return target;
10
+ };
11
+
12
+ //#endregion
13
+ let viem = require("viem");
14
+
15
+ //#region src/chains/cheesecake.ts
16
+ /**
17
+ * Cheesecake is Arkiv's testnet.
18
+ */
19
+ const cheesecake = (0, viem.defineChain)({
20
+ id: 7733102,
21
+ name: "Cheesecake",
22
+ network: "cheesecake",
23
+ nativeCurrency: {
24
+ name: "Golem",
25
+ symbol: "GLM",
26
+ decimals: 18
27
+ },
28
+ rpcUrls: { default: {
29
+ http: ["https://rpc.cheesecake.db-chain.devnet.gobas.me"],
30
+ webSocket: ["wss://rpc.cheesecake.db-chain.devnet.gobas.me"]
31
+ } },
32
+ testnet: true
33
+ });
34
+
35
+ //#endregion
36
+ //#region src/chains/localhost.ts
37
+ const localhost = (0, viem.defineChain)({
38
+ id: 1337,
39
+ name: "Localhost",
40
+ nativeCurrency: {
41
+ decimals: 18,
42
+ name: "Ether",
43
+ symbol: "ETH"
44
+ },
45
+ rpcUrls: { default: { http: ["http://127.0.0.1:8545"] } }
46
+ });
47
+
48
+ //#endregion
49
+ //#region src/chains/index.ts
50
+ var chains_exports = /* @__PURE__ */ __export({
51
+ cheesecake: () => cheesecake,
52
+ localhost: () => localhost
53
+ });
54
+
55
+ //#endregion
56
+ Object.defineProperty(exports, 'chains_exports', {
57
+ enumerable: true,
58
+ get: function () {
59
+ return chains_exports;
60
+ }
61
+ });
62
+ Object.defineProperty(exports, 'cheesecake', {
63
+ enumerable: true,
64
+ get: function () {
65
+ return cheesecake;
66
+ }
67
+ });
68
+ Object.defineProperty(exports, 'localhost', {
69
+ enumerable: true,
70
+ get: function () {
71
+ return localhost;
72
+ }
73
+ });
@@ -0,0 +1,102 @@
1
+ import { Address, Hex } from "viem";
2
+
3
+ //#region src/attr/types.d.ts
4
+
5
+ /**
6
+ * The protocol's attribute type vocabulary, mapping each short **tag** (the name used by the
7
+ * client, the query language and this SDK) to its **typeId** (the byte carried on the wire and in
8
+ * the entity record).
9
+ *
10
+ * The typeIds are consensus-critical: they are written into entity records and mixed into index
11
+ * keys, so this table must never drift from the node's `AttributeType`.
12
+ *
13
+ * | tag | typeId | ABI wire type | indexing |
14
+ * | --------- | ------ | ------------------- | ----------------- |
15
+ * | `bool` | 1 | `bool` | equality |
16
+ * | `i32` | 2 | `int32` | equality + range |
17
+ * | `u64` | 3 | `uint64` | equality + range |
18
+ * | `u256` | 4 | `uint256` | equality + range |
19
+ * | `dec` | 5 | `int256` (18 dp) | equality + range |
20
+ * | `bytes32` | 6 | `bytes32` | equality |
21
+ * | `bytes` | 7 | `bytes` | none — system-only |
22
+ * | `str` | 8 | `string` (<= 128 B) | equality + prefix |
23
+ * | `addr` | 9 | `address` | equality |
24
+ * | `key` | 10 | `bytes32` | equality |
25
+ */
26
+ declare const TYPE_IDS: {
27
+ readonly bool: 1;
28
+ readonly i32: 2;
29
+ readonly u64: 3;
30
+ readonly u256: 4;
31
+ readonly dec: 5;
32
+ readonly bytes32: 6;
33
+ readonly bytes: 7;
34
+ readonly str: 8;
35
+ readonly addr: 9;
36
+ readonly key: 10;
37
+ };
38
+ /** Every type tag, including the system-only `bytes`. */
39
+ type TypeTag = keyof typeof TYPE_IDS;
40
+ /**
41
+ * The tags a client may set on an attribute. `bytes` is excluded: it backs the system `$payload`
42
+ * cell, which travels in its own operation field and is never carried in an attribute array.
43
+ */
44
+ type UserTypeTag = Exclude<TypeTag, "bytes">;
45
+ /**
46
+ * Marks a value as having passed its constructor's validation. The symbol is module-private, so a
47
+ * hand-written object literal is not assignable to {@link ArkivValue} — every value crossing the
48
+ * wire has been range-, length- and format-checked by {@link i32}, {@link u256}, {@link dec}, and
49
+ * friends.
50
+ */
51
+ declare const validated: unique symbol;
52
+ /**
53
+ * A typed attribute value: the tag it was created with, plus the JavaScript representation of that
54
+ * type. Constructed only by the tagged constructors in `@arkiv-network/sdk/attr`.
55
+ *
56
+ * @typeParam tag - The type tag, which also discriminates the {@link ArkivValue} union.
57
+ * @typeParam value - The decoded JavaScript representation.
58
+ */
59
+ type Value<tag extends TypeTag, value> = {
60
+ readonly type: tag;
61
+ readonly value: value;
62
+ readonly [validated]: tag;
63
+ };
64
+ /** A boolean. */
65
+ type BoolValue = Value<"bool", boolean>;
66
+ /** A 32-bit signed integer — the default for an untagged number. */
67
+ type I32Value = Value<"i32", number>;
68
+ /**
69
+ * A 64-bit unsigned integer — block heights, the
70
+ * entity-nonce and `$expiresAt` are all `u64` */
71
+ type U64Value = Value<"u64", bigint>;
72
+ /** A 256-bit unsigned integer. */
73
+ type U256Value = Value<"u256", bigint>;
74
+ /**
75
+ * A fixed-point decimal with 18 decimal places, held as its canonical decimal string (`"3.5"`).
76
+ * Use {@link decUnits} for the exact scaled integer when you need to do arithmetic.
77
+ */
78
+ type DecValue = Value<"dec", string>;
79
+ /** 32 opaque bytes, as lowercase `0x` hex. */
80
+ type Bytes32Value = Value<"bytes32", Hex>;
81
+ /** A UTF-8 string of at most 128 bytes. */
82
+ type StrValue = Value<"str", string>;
83
+ /** A 20-byte Ethereum address, as EIP-55 checksummed hex. */
84
+ type AddrValue = Value<"addr", Address>;
85
+ /** A reference to another entity. Weak by spec: dangling references are permitted. */
86
+ type KeyValue = Value<"key", Hex>;
87
+ /**
88
+ * Opaque variable-length bytes, as lowercase `0x` hex. System-only — it backs `$payload` and is
89
+ * never settable as an attribute, so it is produced by decoding but has no constructor.
90
+ */
91
+ type BytesValue = Value<"bytes", Hex>;
92
+ /** Any value a client may set on an attribute. */
93
+ type ArkivValue = BoolValue | I32Value | U64Value | U256Value | DecValue | Bytes32Value | StrValue | AddrValue | KeyValue;
94
+ /** Any value that can come back from the node, including the system-only `bytes`. */
95
+ type AnyArkivValue = ArkivValue | BytesValue;
96
+ /**
97
+ * Whether `input` has the *shape* of an {@link ArkivValue} — a known type tag and a value.
98
+ */
99
+ declare function isArkivValue(input: unknown): input is AnyArkivValue;
100
+ //#endregion
101
+ export { Bytes32Value as a, I32Value as c, TypeTag as d, U256Value as f, isArkivValue as h, BoolValue as i, KeyValue as l, UserTypeTag as m, AnyArkivValue as n, BytesValue as o, U64Value as p, ArkivValue as r, DecValue as s, AddrValue as t, StrValue as u };
102
+ //# sourceMappingURL=codec-Car3KkFF.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codec-Car3KkFF.d.ts","names":[],"sources":["../src/attr/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAuBA;AAcA;AASA;AAKC;AAiBD;;;;;;;AAOA;AAEA;AAIA;AAEA;AAKA;AAEA;AAEA;AAEA;AAEY,cAzEC,QAyEuB,EAAA;EAKxB,SAAA,IAAU,EAAA,CAAA;EAGV,SAAA,GAAA,EAAU,CAAA;EAClB,SAAA,GAAA,EAAA,CAAA;EACA,SAAA,IAAA,EAAA,CAAA;EACA,SAAA,GAAA,EAAA,CAAA;EACA,SAAA,OAAA,EAAA,CAAA;EACA,SAAA,KAAA,EAAA,CAAA;EACA,SAAA,GAAA,EAAA,CAAA;EACA,SAAA,IAAA,EAAA,CAAA;EACA,SAAA,GAAA,EAAA,EAAA;CACA;;AAGQ,KA/EA,OAAA,GA+Ea,MAAA,OA/EU,QA+EP;;;;;KAtEhB,WAAA,GAAc,QAAQ;;;;;;;cAapB;;;;;;;;KASF,kBAAkB;iBACb;kBACC;YACN,SAAA,GAAY;;;KAIZ,SAAA,GAAY;;KAEZ,QAAA,GAAW;;;;KAIX,QAAA,GAAW;;KAEX,SAAA,GAAY;;;;;KAKZ,QAAA,GAAW;;KAEX,YAAA,GAAe,iBAAiB;;KAEhC,QAAA,GAAW;;KAEX,SAAA,GAAY,cAAc;;KAE1B,QAAA,GAAW,aAAa;;;;;KAKxB,UAAA,GAAa,eAAe;;KAG5B,UAAA,GACR,YACA,WACA,WACA,YACA,WACA,eACA,WACA,YACA;;KAGQ,aAAA,GAAgB,aAAa;;;;iBAsBzB,YAAA,2BAAuC"}
@@ -0,0 +1,20 @@
1
+ const require_expiry = require('../expiry-BELY2Kpw.cjs');
2
+ const require_key = require('../key-WKhXnXuU.cjs');
3
+ const require_errors = require('../errors-BVbjKVMN.cjs');
4
+ const require_flags = require('../flags-kr276q6i.cjs');
5
+ require('../entity-B7G8q_Eo.cjs');
6
+
7
+ exports.ENTITY_EVENTS_ABI = require_key.ENTITY_EVENTS_ABI;
8
+ exports.InvalidCreationFlagsError = require_errors.InvalidCreationFlagsError;
9
+ exports.InvalidExpiryError = require_errors.InvalidExpiryError;
10
+ exports.InvalidSaltError = require_errors.InvalidSaltError;
11
+ exports.MAX_EXPIRES_AT = require_expiry.MAX_EXPIRES_AT;
12
+ exports.MAX_SALT = require_key.MAX_SALT;
13
+ exports.NoRandomSourceError = require_errors.NoRandomSourceError;
14
+ exports.OperationType = require_expiry.OperationType;
15
+ exports.decodeCreationFlags = require_flags.decodeCreationFlags;
16
+ exports.encodeCreationFlags = require_flags.encodeCreationFlags;
17
+ exports.predictEntityKey = require_key.predictEntityKey;
18
+ exports.randomSalt = require_key.randomSalt;
19
+ exports.resolveExpiry = require_expiry.resolveExpiry;
20
+ exports.toBlocks = require_expiry.toBlocks;
@@ -0,0 +1,4 @@
1
+ import { a as ResolvedExpiry, i as Lifetime, n as Expiry, o as resolveExpiry, r as ExpiryContext, s as toBlocks, t as EncodedExpiry } from "../expiry-DRV29F1r.cjs";
2
+ import { a as randomSalt, c as InvalidCreationFlagsError, d as NoRandomSourceError, f as Operation, i as predictEntityKey, l as InvalidExpiryError, n as OperationType, o as ENTITY_EVENTS_ABI, r as MAX_SALT, s as EntityEventName, t as MAX_EXPIRES_AT, u as InvalidSaltError } from "../index-CA4V7Pdh.cjs";
3
+ import { i as encodeCreationFlags, n as ResolvedCreationFlags, r as decodeCreationFlags, t as CreationFlags } from "../flags-CRjPpoh3.cjs";
4
+ export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, Operation, OperationType, ResolvedCreationFlags, ResolvedExpiry, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
@@ -0,0 +1,5 @@
1
+ import "../codec-Car3KkFF.js";
2
+ import { a as ResolvedExpiry, i as Lifetime, n as Expiry, o as resolveExpiry, r as ExpiryContext, s as toBlocks, t as EncodedExpiry } from "../expiry-nDbCgZX4.js";
3
+ import { a as randomSalt, c as InvalidCreationFlagsError, d as NoRandomSourceError, f as Operation, i as predictEntityKey, l as InvalidExpiryError, n as OperationType, o as ENTITY_EVENTS_ABI, r as MAX_SALT, s as EntityEventName, t as MAX_EXPIRES_AT, u as InvalidSaltError } from "../index-fX_XyqLp.js";
4
+ import { i as encodeCreationFlags, n as ResolvedCreationFlags, r as decodeCreationFlags, t as CreationFlags } from "../flags-5dTNRnow.js";
5
+ export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, Operation, OperationType, ResolvedCreationFlags, ResolvedExpiry, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
@@ -0,0 +1,7 @@
1
+ import { a as OperationType, i as MAX_EXPIRES_AT, n as resolveExpiry, r as toBlocks } from "../expiry-BjpxZZQU.js";
2
+ import { a as ENTITY_EVENTS_ABI, n as predictEntityKey, r as randomSalt, t as MAX_SALT } from "../key-D1Bh7MF0.js";
3
+ import { i as NoRandomSourceError, n as InvalidExpiryError, r as InvalidSaltError, t as InvalidCreationFlagsError } from "../errors-LTe7bOYS.js";
4
+ import { n as encodeCreationFlags, t as decodeCreationFlags } from "../flags-DFBs2J94.js";
5
+ import "../entity-CD_qFF2M.js";
6
+
7
+ export { ENTITY_EVENTS_ABI, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, OperationType, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
@@ -0,0 +1,71 @@
1
+ let viem = require("viem");
2
+
3
+ //#region src/types/entity.ts
4
+ /**
5
+ * An entity as it comes back from a query.
6
+ *
7
+ * Which fields are populated is decided by the query's selection — `select({ key: true })` gives
8
+ * back an entity carrying only its key. The static type of a `select()` result is narrowed to
9
+ * exactly the selected fields, so in typed code the `undefined`s here are not reachable.
10
+ */
11
+ var Entity = class {
12
+ key;
13
+ owner;
14
+ creator;
15
+ createdAt;
16
+ updatedAt;
17
+ expiresAt;
18
+ creationFlags;
19
+ contentType;
20
+ payload;
21
+ attributeSchema;
22
+ attributes;
23
+ constructor(fields = {}) {
24
+ this.key = fields.key;
25
+ this.owner = fields.owner;
26
+ this.creator = fields.creator;
27
+ this.createdAt = fields.createdAt;
28
+ this.updatedAt = fields.updatedAt;
29
+ this.expiresAt = fields.expiresAt;
30
+ this.creationFlags = fields.creationFlags;
31
+ this.contentType = fields.contentType;
32
+ this.payload = fields.payload;
33
+ this.attributeSchema = fields.attributeSchema;
34
+ this.attributes = fields.attributes;
35
+ }
36
+ /**
37
+ * The payload decoded as UTF-8 text.
38
+ *
39
+ * @throws If the payload was not selected, or is not valid UTF-8.
40
+ */
41
+ toText() {
42
+ if (this.payload === void 0) throw new Error("Entity has no payload — the query did not select it. Use select({ payload: true }).");
43
+ try {
44
+ return (0, viem.bytesToString)(this.payload);
45
+ } catch (e) {
46
+ throw new Error(`Failed to convert entity payload to text: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
47
+ }
48
+ }
49
+ /**
50
+ * The payload parsed as JSON.
51
+ *
52
+ * @throws If the payload was not selected, is empty, or is not valid JSON.
53
+ */
54
+ toJson() {
55
+ const text = this.toText();
56
+ if (!text) throw new Error("Entity has empty payload, cannot parse as JSON");
57
+ try {
58
+ return JSON.parse(text);
59
+ } catch (e) {
60
+ throw new Error(`Failed to parse entity payload as JSON: ${e instanceof Error ? e.message : String(e)}`, { cause: e });
61
+ }
62
+ }
63
+ };
64
+
65
+ //#endregion
66
+ Object.defineProperty(exports, 'Entity', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return Entity;
70
+ }
71
+ });
File without changes