@arkiv-network/sdk 0.7.0 → 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 +39 -77
  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 +422 -399
  74. package/dist/index.d.cts +364 -204
  75. package/dist/index.d.cts.map +1 -1
  76. package/dist/index.d.ts +365 -204
  77. package/dist/index.d.ts.map +1 -1
  78. package/dist/index.js +357 -389
  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 -149
  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 -137
  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 +4 -1
  105. package/dist/types/index.d.cts +7 -2
  106. package/dist/types/index.d.ts +8 -2
  107. package/dist/types/index.js +4 -1
  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 +8 -8
  129. package/src/actions/wallet/createEntity.ts +104 -26
  130. package/src/actions/wallet/deleteEntity.ts +2 -3
  131. package/src/actions/wallet/extendEntity.ts +39 -16
  132. package/src/actions/wallet/mutateEntities.test.ts +76 -0
  133. package/src/actions/wallet/mutateEntities.ts +23 -83
  134. package/src/actions/wallet/patchEntity.ts +90 -0
  135. package/src/attr/attributes.test.ts +120 -0
  136. package/src/attr/attributes.ts +190 -0
  137. package/src/attr/codec.test.ts +162 -0
  138. package/src/attr/codec.ts +220 -0
  139. package/src/attr/decimal.ts +86 -0
  140. package/src/attr/errors.ts +145 -0
  141. package/src/attr/index.ts +50 -0
  142. package/src/attr/names.ts +106 -0
  143. package/src/attr/types.ts +150 -0
  144. package/src/attr/values.test.ts +271 -0
  145. package/src/attr/values.ts +502 -0
  146. package/src/chains/cheesecake.ts +22 -0
  147. package/src/chains/index.ts +1 -2
  148. package/src/clients/createPublicClient.test.ts +3 -5
  149. package/src/clients/createPublicClient.ts +5 -4
  150. package/src/clients/createWalletClient.test.ts +2 -2
  151. package/src/clients/createWalletClient.ts +13 -7
  152. package/src/clients/decorators/arkivAdvanced.ts +144 -0
  153. package/src/clients/decorators/arkivPublic.ts +172 -139
  154. package/src/clients/decorators/arkivWallet.ts +106 -95
  155. package/src/consts.ts +2 -1
  156. package/src/entity/create.test.ts +184 -0
  157. package/src/entity/errors.ts +38 -0
  158. package/src/entity/events.ts +16 -0
  159. package/src/entity/expiry.test.ts +195 -0
  160. package/src/entity/expiry.ts +181 -0
  161. package/src/entity/flags.ts +65 -0
  162. package/src/entity/index.ts +15 -0
  163. package/src/entity/key.ts +68 -0
  164. package/src/entity/operations.ts +134 -0
  165. package/src/entity/params.ts +15 -0
  166. package/src/errors.ts +33 -28
  167. package/src/index.ts +19 -0
  168. package/src/query/engine.ts +68 -132
  169. package/src/query/errors.ts +151 -0
  170. package/src/query/expression.test.ts +286 -0
  171. package/src/query/expression.ts +493 -0
  172. package/src/query/index.ts +40 -4
  173. package/src/query/injection.test.ts +151 -0
  174. package/src/query/queryBuilder.test.ts +342 -637
  175. package/src/query/queryBuilder.ts +133 -359
  176. package/src/query/queryResult.ts +54 -51
  177. package/src/query/selection.test.ts +48 -98
  178. package/src/query/selection.ts +77 -65
  179. package/src/types/entity.test.ts +44 -155
  180. package/src/types/entity.ts +62 -44
  181. package/src/types/events.ts +64 -23
  182. package/src/types/index.ts +20 -16
  183. package/src/types/rpcSchema.ts +70 -33
  184. package/src/utils/arkivTransactions.test.ts +681 -38
  185. package/src/utils/arkivTransactions.ts +400 -115
  186. package/src/utils/chains.test.ts +21 -24
  187. package/src/utils/compression.ts +1 -1
  188. package/src/utils/entities.test.ts +62 -0
  189. package/src/utils/entities.ts +111 -29
  190. package/src/utils/expirationTime.ts +114 -10
  191. package/src/utils/logger.ts +2 -2
  192. package/src/utils/payload.ts +4 -2
  193. package/src/utils/revert.test.ts +99 -0
  194. package/src/utils/revert.ts +145 -0
  195. package/dist/chains-BifaY04V.cjs +0 -108
  196. package/dist/chains-CrtkVbBh.js +0 -86
  197. package/dist/chains-CrtkVbBh.js.map +0 -1
  198. package/dist/consts-AUoL-v42.cjs +0 -18
  199. package/dist/consts-BV4PR-de.js +0 -7
  200. package/dist/consts-BV4PR-de.js.map +0 -1
  201. package/dist/entity-B6g_EPm1.d.cts +0 -382
  202. package/dist/entity-B6g_EPm1.d.cts.map +0 -1
  203. package/dist/entity-qoLMAuuk.d.ts +0 -382
  204. package/dist/entity-qoLMAuuk.d.ts.map +0 -1
  205. package/dist/index-DdspxNAA.d.ts +0 -481
  206. package/dist/index-DdspxNAA.d.ts.map +0 -1
  207. package/dist/index-Ds9dwqb5.d.cts +0 -481
  208. package/dist/index-Ds9dwqb5.d.cts.map +0 -1
  209. package/dist/payload-B2kFJyah.d.ts +0 -6
  210. package/dist/payload-B2kFJyah.d.ts.map +0 -1
  211. package/dist/payload-CJN8fTvX.d.cts +0 -6
  212. package/dist/payload-CJN8fTvX.d.cts.map +0 -1
  213. package/dist/payload-Claf2jUO.js +0 -13
  214. package/dist/payload-Claf2jUO.js.map +0 -1
  215. package/dist/payload-DpA5PA-w.cjs +0 -23
  216. package/dist/query/index.js.map +0 -1
  217. package/dist/queryBuilder-D2uwP9jI.js +0 -704
  218. package/dist/queryBuilder-D2uwP9jI.js.map +0 -1
  219. package/dist/queryBuilder-UW2MCaX4.cjs +0 -792
  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 -119
  225. package/src/actions/wallet/updateEntity.ts +0 -60
  226. package/src/chains/braga.ts +0 -26
  227. package/src/chains/kaolin.ts +0 -29
  228. package/src/query/engine.test.ts +0 -526
  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 -210
  233. package/src/types/attributes.ts +0 -16
  234. package/src/utils/validation.test.ts +0 -60
  235. package/src/utils/validation.ts +0 -32
  236. /package/dist/{types-H-TSmRpm.js → attr-DlmErkvR.cjs} +0 -0
  237. /package/dist/{types-o3zWarRp.cjs → attr-GcQKatub.js} +0 -0
@@ -1,382 +0,0 @@
1
- import { Account, Chain, Client, Hash, Hex, RpcSchema, Transport } from "viem";
2
-
3
- //#region src/types/mimeTypes.d.ts
4
- type MimeType = "text/plain" | "text/html" | "text/css" | "text/csv" | "text/xml" | "text/javascript" | "application/json" | "application/xml" | "application/pdf" | "application/zip" | "application/gzip" | "application/octet-stream" | "application/javascript" | "application/x-www-form-urlencoded" | "image/png" | "image/jpeg" | "image/webp" | "image/gif" | "image/svg+xml" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "video/mp4" | "video/webm" | "video/ogg" | "multipart/form-data";
5
- //#endregion
6
- //#region src/types/rpcSchema.d.ts
7
- type RpcEntity = {
8
- key: Hex;
9
- contentType: MimeType;
10
- value: string;
11
- expiresAt: Hex;
12
- createdAtBlock: Hex;
13
- lastModifiedAtBlock: Hex;
14
- transactionIndexInBlock: Hex;
15
- operationIndexInTransaction: Hex;
16
- owner: Hex;
17
- creator: Hex;
18
- stringAttributes?: [{
19
- key: string;
20
- value: string;
21
- }];
22
- numericAttributes?: [{
23
- key: string;
24
- value: Hex;
25
- }];
26
- };
27
- type RpcOrderByAttribute = {
28
- name: string;
29
- type: "string" | "numeric";
30
- desc: boolean;
31
- };
32
- type RpcQueryOptions = {
33
- atBlock?: Hex;
34
- includeData?: RpcIncludeData;
35
- orderBy?: RpcOrderByAttribute[];
36
- resultsPerPage?: Hex;
37
- cursor?: string;
38
- };
39
- type RpcIncludeData = {
40
- key?: boolean;
41
- attributes?: boolean;
42
- payload?: boolean;
43
- contentType?: boolean;
44
- expiration?: boolean;
45
- owner?: boolean;
46
- creator?: boolean;
47
- createdAtBlock?: boolean;
48
- lastModifiedAtBlock?: boolean;
49
- transactionIndexInBlock?: boolean;
50
- operationIndexInTransaction?: boolean;
51
- };
52
- type ArkivRpcSchema = [{
53
- Method: "arkiv_query";
54
- Parameters?: [query: string, queryOptions?: RpcQueryOptions];
55
- ReturnType: {
56
- data: RpcEntity[];
57
- blockNumber: Hex;
58
- cursor: string;
59
- };
60
- }, {
61
- Method: "arkiv_getBlockTiming";
62
- Parameters?: [];
63
- ReturnType: {
64
- current_block: bigint;
65
- current_block_time: number;
66
- duration: number;
67
- };
68
- }, {
69
- Method: "arkiv_getEntityCount";
70
- Parameters?: [];
71
- ReturnType: number;
72
- }];
73
- //#endregion
74
- //#region src/clients/baseClient.d.ts
75
- type ArkivClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, accountOrAddress extends Account | undefined = Account | undefined, rpcSchema extends RpcSchema | undefined = ArkivRpcSchema> = Client<transport, chain, accountOrAddress, rpcSchema>;
76
- //#endregion
77
- //#region src/actions/public/getBlockTiming.d.ts
78
- type GetBlockTimingReturnType = {
79
- currentBlock: bigint;
80
- currentBlockTime: number;
81
- blockDuration: number;
82
- };
83
- //#endregion
84
- //#region src/actions/public/query.d.ts
85
- type QueryOptionsIncludeData = {
86
- attributes?: boolean;
87
- payload?: boolean;
88
- metadata?: boolean;
89
- };
90
- /**
91
- * @deprecated Server-side ordering is not supported by the network. Sort the fetched
92
- * entities in JavaScript instead (e.g. `entities.sort(...)`). This type will be removed
93
- * in a future release.
94
- */
95
- type QueryOptionsOrderBy = {
96
- name: string;
97
- type: "string" | "numeric";
98
- desc: "asc" | "desc";
99
- };
100
- type QueryOptions = {
101
- includeData?: QueryOptionsIncludeData;
102
- atBlock?: bigint;
103
- /**
104
- * @deprecated Server-side ordering is not supported by the network, so this option has no
105
- * effect on the returned order. Sort the fetched entities in JavaScript instead
106
- * (e.g. `entities.sort(...)`). This option will be removed in a future release.
107
- */
108
- orderBy?: QueryOptionsOrderBy[];
109
- resultsPerPage?: number | undefined;
110
- cursor?: string | undefined;
111
- };
112
- type QueryReturnType = {
113
- entities: Entity[];
114
- cursor: string | undefined;
115
- blockNumber: bigint | undefined;
116
- };
117
- //#endregion
118
- //#region src/actions/wallet/changeOwnership.d.ts
119
- /**
120
- * Parameters for the deleteEntity function.
121
- * - entityKey: The key of the entity to delete.
122
- */
123
- type ChangeOwnershipParameters = {
124
- entityKey: Hex;
125
- newOwner: Hex;
126
- };
127
- /**
128
- * Return type for the deleteEntity function.
129
- * - entityKey: The key of the entity.
130
- * - txHash: The transaction hash.
131
- */
132
- type ChangeOwnershipReturnType = {
133
- entityKey: Hex;
134
- txHash: string;
135
- };
136
- //#endregion
137
- //#region src/actions/wallet/createEntity.d.ts
138
- /**
139
- * Parameters for the createEntity function.
140
- * - payload: The payload of the entity.
141
- * - attributes: The attributes of the entity. Attribute values may be strings
142
- * or numbers, but numeric values **must be integers**. To store a non-integer,
143
- * scale it to an integer (e.g. `1.5` -> `1500`) to preserve numeric ordering,
144
- * or pass it as a string (e.g. `"1.5"`). A non-integer numeric value throws an
145
- * {@link InvalidAttributeError}.
146
- * - contentType: The content type of the entity.
147
- * - expiresIn: How long until the entity expires, in seconds. Because Arkiv
148
- * measures expiration in blocks (1 block = 2 seconds), this **must be a
149
- * positive integer and a multiple of the block time (2 seconds)**
150
- * Invalid values throw an {@link InvalidExpirationError}.
151
- */
152
- type CreateEntityParameters = {
153
- payload: Uint8Array;
154
- /** Entity attributes. Numeric values must be integers (scale non-integers, e.g. `1.5` -> `1500`, or use a string). Throws {@link InvalidAttributeError} otherwise. */
155
- attributes: Attribute[];
156
- contentType: MimeType | string;
157
- /** Seconds until expiry. Must be a positive integer and a multiple of the 2s block time.
158
- * Throws {@link InvalidExpirationError} otherwise. */
159
- expiresIn: number;
160
- };
161
- /**
162
- * Return type for the createEntity function.
163
- * - entityKey: The key of the entity.
164
- * - txHash: The transaction hash.
165
- */
166
- type CreateEntityReturnType = {
167
- entityKey: Hex;
168
- txHash: Hash;
169
- };
170
- //#endregion
171
- //#region src/actions/wallet/deleteEntity.d.ts
172
- /**
173
- * Parameters for the deleteEntity function.
174
- * - entityKey: The key of the entity to delete.
175
- */
176
- type DeleteEntityParameters = {
177
- entityKey: Hex;
178
- };
179
- /**
180
- * Return type for the deleteEntity function.
181
- * - entityKey: The key of the entity.
182
- * - txHash: The transaction hash.
183
- */
184
- type DeleteEntityReturnType = {
185
- entityKey: Hex;
186
- txHash: Hash;
187
- };
188
- //#endregion
189
- //#region src/actions/wallet/extendEntity.d.ts
190
- /**
191
- * Parameters for the extendEntity function.
192
- * - entityKey: The key of the entity to extend.
193
- * - expiresIn: How long to extend the entity by, in seconds. Because Arkiv
194
- * measures expiration in blocks (1 block = 2 seconds), this **must be a
195
- * positive integer and a multiple of the block time (2 seconds)**.
196
- * Invalid values throw an {@link InvalidExpirationError}.
197
- */
198
- type ExtendEntityParameters = {
199
- entityKey: Hex;
200
- /** Seconds to extend by. Must be a positive integer and a multiple of the 2s block time.
201
- * Throws {@link InvalidExpirationError} otherwise. */
202
- expiresIn: number;
203
- };
204
- /**
205
- * Return type for the extendEntity function.
206
- * - entityKey: The key of the entity.
207
- * - txHash: The transaction hash.
208
- */
209
- type ExtendEntityReturnType = {
210
- entityKey: Hex;
211
- txHash: Hash;
212
- };
213
- //#endregion
214
- //#region src/actions/wallet/updateEntity.d.ts
215
- /**
216
- * Parameters for the updateEntity function.
217
- * - entityKey: The key of the entity to update.
218
- * - payload: The payload of the entity.
219
- * - attributes: The attributes of the entity. Attribute values may be strings
220
- * or numbers, but numeric values **must be integers**. To store a non-integer,
221
- * scale it to an integer (e.g. `1.5` -> `1500`) to preserve numeric ordering,
222
- * or pass it as a string (e.g. `"1.5"`). A non-integer numeric value throws an
223
- * {@link InvalidAttributeError}.
224
- * - contentType: The content type of the entity.
225
- * - expiresIn: How long until the entity expires, in seconds. Because Arkiv
226
- * measures expiration in blocks (1 block = 2 seconds), this **must be a
227
- * positive integer and a multiple of the block time (2 seconds)**.
228
- * Invalid values throw an {@link InvalidExpirationError}.
229
- */
230
- type UpdateEntityParameters = {
231
- entityKey: Hex;
232
- payload: Uint8Array;
233
- /** Entity attributes. Numeric values must be integers (scale non-integers, e.g. `1.5` -> `1500`, or use a string). Throws {@link InvalidAttributeError} otherwise. */
234
- attributes: Attribute[];
235
- contentType: MimeType | string;
236
- /** Seconds until expiry. Must be a positive integer and a multiple of the 2s block time.
237
- * Throws {@link InvalidExpirationError} otherwise. */
238
- expiresIn: number;
239
- };
240
- /**
241
- * Return type for the updateEntity function.
242
- * - entityKey: The key of the entity.
243
- * - txHash: The transaction hash.
244
- */
245
- type UpdateEntityReturnType = {
246
- entityKey: Hex;
247
- txHash: Hash;
248
- };
249
- //#endregion
250
- //#region src/actions/wallet/mutateEntities.d.ts
251
- /**
252
- * Parameters for the mutateEntities function.
253
- * - creates: The creates to perform.
254
- * - updates: The updates to perform.
255
- * - deletes: The deletes to perform.
256
- * - extensions: The extensions to perform.
257
- */
258
- type MutateEntitiesParameters = {
259
- creates?: CreateEntityParameters[];
260
- updates?: UpdateEntityParameters[];
261
- deletes?: DeleteEntityParameters[];
262
- extensions?: ExtendEntityParameters[];
263
- ownershipChanges?: ChangeOwnershipParameters[];
264
- };
265
- /**
266
- * Return type for the mutateEntities function.
267
- * - txHash: The transaction hash.
268
- * - createdEntities: The keys of the created entities.
269
- * - updatedEntities: The keys of the updated entities.
270
- * - deletedEntities: The keys of the deleted entities.
271
- * - extendedEntities: The keys of the extended entities.
272
- * - ownershipChanges: The keys of the ownership changes.
273
- */
274
- type MutateEntitiesReturnType = {
275
- txHash: Hash;
276
- createdEntities: Hex[];
277
- updatedEntities: Hex[];
278
- deletedEntities: Hex[];
279
- extendedEntities: Hex[];
280
- ownershipChanges: Hex[];
281
- };
282
- //#endregion
283
- //#region src/types/attributes.d.ts
284
- /**
285
- * An entity attribute (key/value pair).
286
- *
287
- * Arkiv supports both string and number values. Numeric values **must be
288
- * integers** — passing a non-integer number (e.g. `1.5`) throws an
289
- * {@link InvalidAttributeError} at mutation time. To store a non-integer value:
290
- * - Scale it to an integer (e.g. `1.5` -> `1500`, dividing by the same factor on
291
- * read) to keep numeric ordering and range queries working.
292
- * - Or pass it as a string (e.g. `"1.5"`), which sorts lexicographically and so
293
- * does not support numeric comparisons.
294
- */
295
- type Attribute = {
296
- key: string;
297
- /** Attribute value. A `number` must be an integer (scale non-integers, e.g. `1.5` -> `1500`, or use a string). Throws {@link InvalidAttributeError} otherwise. */
298
- value: string | number;
299
- };
300
- //#endregion
301
- //#region src/types/events.d.ts
302
- type OnEntityCreatedEvent = {
303
- entityKey: Hex;
304
- owner: Hex;
305
- expirationBlock: number;
306
- cost: bigint;
307
- };
308
- type OnEntityUpdatedEvent = {
309
- entityKey: Hex;
310
- owner: Hex;
311
- oldExpirationBlock: number;
312
- newExpirationBlock: number;
313
- cost: bigint;
314
- };
315
- type OnEntityDeletedEvent = {
316
- entityKey: Hex;
317
- owner: Hex;
318
- };
319
- type OnEntityExpiredEvent = {
320
- entityKey: Hex;
321
- owner: Hex;
322
- };
323
- type OnEntityExpiresInExtendedEvent = {
324
- entityKey: Hex;
325
- owner: Hex;
326
- oldExpirationBlock: number;
327
- newExpirationBlock: number;
328
- cost: bigint;
329
- };
330
- type OnEntityOwnerChangedEvent = {
331
- entityKey: Hex;
332
- oldOwner: Hex;
333
- newOwner: Hex;
334
- };
335
- //#endregion
336
- //#region src/types/txParams.d.ts
337
- type TxParams = {
338
- gas?: bigint;
339
- nonce?: number;
340
- gasPrice?: bigint;
341
- maxFeePerGas?: never;
342
- maxPriorityFeePerGas?: never;
343
- } | {
344
- gas?: bigint;
345
- nonce?: number;
346
- maxFeePerGas?: bigint;
347
- maxPriorityFeePerGas?: bigint;
348
- gasPrice?: never;
349
- };
350
- //#endregion
351
- //#region src/types/entity.d.ts
352
- declare class Entity {
353
- key: Hex;
354
- contentType: MimeType | undefined;
355
- owner: Hex | undefined;
356
- creator: Hex | undefined;
357
- expiresAtBlock: bigint | undefined;
358
- createdAtBlock: bigint | undefined;
359
- lastModifiedAtBlock: bigint | undefined;
360
- transactionIndexInBlock: bigint | undefined;
361
- operationIndexInTransaction: bigint | undefined;
362
- payload: Uint8Array | undefined;
363
- attributes: Attribute[];
364
- constructor(key: Hex, contentType: MimeType | undefined, owner: Hex | undefined, creator: Hex | undefined, expiresAtBlock: bigint | undefined, createdAtBlock: bigint | undefined, lastModifiedAtBlock: bigint | undefined, transactionIndexInBlock: bigint | undefined, operationIndexInTransaction: bigint | undefined, payload: Uint8Array | undefined, attributes: Attribute[]);
365
- /**
366
- * Converts the entity payload from bytes to a string and returns it.
367
- * Throws an error if the payload is undefined, which may occur if the entity was not queried with the withPayload option.
368
- * Throws an error if the conversion from bytes to string fails.
369
- * @returns The entity payload as a string.
370
- */
371
- toText(): string;
372
- /**
373
- * Parses the entity payload as JSON and returns the resulting object.
374
- * Throws an error if the payload is undefined, which may occur if the entity was not queried with the withPayload option.
375
- * Throws an error if the payload is empty or cannot be parsed as JSON.
376
- * @returns The parsed JSON object from the entity payload.
377
- */
378
- toJson(): any;
379
- }
380
- //#endregion
381
- export { RpcIncludeData as A, QueryOptionsIncludeData as C, ArkivClient as D, GetBlockTimingReturnType as E, RpcQueryOptions as M, MimeType as N, ArkivRpcSchema as O, QueryOptions as S, QueryReturnType as T, DeleteEntityReturnType as _, OnEntityExpiredEvent as a, ChangeOwnershipParameters as b, OnEntityUpdatedEvent as c, MutateEntitiesReturnType as d, UpdateEntityParameters as f, DeleteEntityParameters as g, ExtendEntityReturnType as h, OnEntityDeletedEvent as i, RpcOrderByAttribute as j, RpcEntity as k, Attribute as l, ExtendEntityParameters as m, TxParams as n, OnEntityExpiresInExtendedEvent as o, UpdateEntityReturnType as p, OnEntityCreatedEvent as r, OnEntityOwnerChangedEvent as s, Entity as t, MutateEntitiesParameters as u, CreateEntityParameters as v, QueryOptionsOrderBy as w, ChangeOwnershipReturnType as x, CreateEntityReturnType as y };
382
- //# sourceMappingURL=entity-qoLMAuuk.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"entity-qoLMAuuk.d.ts","names":[],"sources":["../src/types/mimeTypes.ts","../src/types/rpcSchema.ts","../src/clients/baseClient.ts","../src/actions/public/getBlockTiming.ts","../src/actions/public/query.ts","../src/actions/wallet/changeOwnership.ts","../src/actions/wallet/createEntity.ts","../src/actions/wallet/deleteEntity.ts","../src/actions/wallet/extendEntity.ts","../src/actions/wallet/updateEntity.ts","../src/actions/wallet/mutateEntities.ts","../src/types/attributes.ts","../src/types/events.ts","../src/types/txParams.ts","../src/types/entity.ts"],"sourcesContent":[],"mappings":";;;KAAY,QAAA;;;KCGA,SAAA;EDHA,GAAA,ECIL,GDJK;eCKG;;aAEF;EAJD,cAAS,EAKH,GALG;EACd,mBAAA,EAKgB,GALhB;EACQ,uBAAA,EAKY,GALZ;EAEF,2BAAA,EAIkB,GAJlB;EACK,KAAA,EAIT,GAJS;EACK,OAAA,EAIZ,GAJY;EACI,gBAAA,CAAA,EAAA,CAAA;IACI,GAAA,EAAA,MAAA;IACtB,KAAA,EAAA,MAAA;EACE,CAAA,CAAA;EAEkC,iBAAA,CAAA,EAAA,CAAA;IAAG,GAAA,EAAA,MAAA;IAGpC,KAAA,EAHiC,GAGjC;EAMA,CAAA,CAAA;CACA;AACI,KARJ,mBAAA,GAQI;EACJ,IAAA,EAAA,MAAA;EACO,IAAA,EAAA,QAAA,GAAA,SAAA;EAAG,IAAA,EAAA,OAAA;AAItB,CAAA;AAcY,KAtBA,eAAA,GAsBc;EAGsB,OAAA,CAAA,EAxBpC,GAwBoC;EAEpC,WAAA,CAAA,EAzBI,cAyBJ;EACO,OAAA,CAAA,EAzBP,mBAyBO,EAAA;EAAG,cAAA,CAAA,EAxBH,GAwBG;;;KApBV,cAAA;EC7BA,GAAA,CAAA,EAAA,OAAA;EACQ,UAAA,CAAA,EAAA,OAAA;EAAY,OAAA,CAAA,EAAA,OAAA;EAChB,WAAA,CAAA,EAAA,OAAA;EAAoB,UAAA,CAAA,EAAA,OAAA;EACT,KAAA,CAAA,EAAA,OAAA;EAAsB,OAAA,CAAA,EA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