@arkiv-network/sdk 0.7.0 → 0.8.0-dev.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 (210) hide show
  1. package/README.md +29 -16
  2. package/dist/attr/index.cjs +34 -0
  3. package/dist/attr/index.d.cts +2 -0
  4. package/dist/attr/index.d.ts +2 -0
  5. package/dist/attr/index.js +3 -0
  6. package/dist/attr-BDZ-APg5.js +809 -0
  7. package/dist/attr-BDZ-APg5.js.map +1 -0
  8. package/dist/attr-BvxHN99W.cjs +1029 -0
  9. package/dist/chains/index.cjs +2 -3
  10. package/dist/chains/index.d.cts +39 -77
  11. package/dist/chains/index.d.cts.map +1 -1
  12. package/dist/chains/index.d.ts +22 -60
  13. package/dist/chains/index.d.ts.map +1 -1
  14. package/dist/chains/index.js +2 -2
  15. package/dist/chains-BJrZs6sG.js +57 -0
  16. package/dist/chains-BJrZs6sG.js.map +1 -0
  17. package/dist/chains-BYRTTipa.cjs +73 -0
  18. package/dist/changeOwnership-B7bEgla4.d.cts +509 -0
  19. package/dist/changeOwnership-B7bEgla4.d.cts.map +1 -0
  20. package/dist/changeOwnership-DwgtdSFc.d.ts +509 -0
  21. package/dist/changeOwnership-DwgtdSFc.d.ts.map +1 -0
  22. package/dist/entity/index.cjs +19 -0
  23. package/dist/entity/index.d.cts +4 -0
  24. package/dist/entity/index.d.ts +4 -0
  25. package/dist/entity/index.js +6 -0
  26. package/dist/entity-B0t6sN7F.cjs +71 -0
  27. package/dist/entity-BIp_df9u.js +67 -0
  28. package/dist/entity-BIp_df9u.js.map +1 -0
  29. package/dist/entity-CFhbAv0R.js +70 -0
  30. package/dist/entity-CFhbAv0R.js.map +1 -0
  31. package/dist/entity-wfBnZd91.cjs +98 -0
  32. package/dist/errors-D-eJkGVc.cjs +56 -0
  33. package/dist/errors-DGB8AgT2.js +33 -0
  34. package/dist/errors-DGB8AgT2.js.map +1 -0
  35. package/dist/expiry-BUYIXTGb.cjs +135 -0
  36. package/dist/expiry-BxOlvVWC.d.ts +79 -0
  37. package/dist/expiry-BxOlvVWC.d.ts.map +1 -0
  38. package/dist/expiry-DGRzrSan.js +95 -0
  39. package/dist/expiry-DGRzrSan.js.map +1 -0
  40. package/dist/expiry-DRV29F1r.d.cts +79 -0
  41. package/dist/expiry-DRV29F1r.d.cts.map +1 -0
  42. package/dist/flags-0Vl5rrHq.d.cts +41 -0
  43. package/dist/flags-0Vl5rrHq.d.cts.map +1 -0
  44. package/dist/flags-Ct8k0gpB.cjs +43 -0
  45. package/dist/flags-ZtlvOIIk.js +33 -0
  46. package/dist/flags-ZtlvOIIk.js.map +1 -0
  47. package/dist/flags-wmcMoAnN.d.ts +41 -0
  48. package/dist/flags-wmcMoAnN.d.ts.map +1 -0
  49. package/dist/index-Cgw1u5aY.d.cts +278 -0
  50. package/dist/index-Cgw1u5aY.d.cts.map +1 -0
  51. package/dist/index-ClgIuxJ8.d.ts +159 -0
  52. package/dist/index-ClgIuxJ8.d.ts.map +1 -0
  53. package/dist/index-D0CmtiWT.d.cts +159 -0
  54. package/dist/index-D0CmtiWT.d.cts.map +1 -0
  55. package/dist/index-D8LZt-3J.d.cts +417 -0
  56. package/dist/index-D8LZt-3J.d.cts.map +1 -0
  57. package/dist/index-DVYFaXNV.d.ts +417 -0
  58. package/dist/index-DVYFaXNV.d.ts.map +1 -0
  59. package/dist/index-VCqgn29D.d.ts +278 -0
  60. package/dist/index-VCqgn29D.d.ts.map +1 -0
  61. package/dist/index.cjs +675 -357
  62. package/dist/index.d.cts +251 -203
  63. package/dist/index.d.cts.map +1 -1
  64. package/dist/index.d.ts +251 -203
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +626 -355
  67. package/dist/index.js.map +1 -1
  68. package/dist/payload-Bnw1hrvb.cjs +83 -0
  69. package/dist/payload-CIxSn_DW.js +67 -0
  70. package/dist/payload-CIxSn_DW.js.map +1 -0
  71. package/dist/payload-Dgx3PQeK.d.ts +94 -0
  72. package/dist/payload-Dgx3PQeK.d.ts.map +1 -0
  73. package/dist/payload-P0nWyjLg.d.cts +94 -0
  74. package/dist/payload-P0nWyjLg.d.cts.map +1 -0
  75. package/dist/query/index.cjs +24 -149
  76. package/dist/query/index.d.cts +5 -3
  77. package/dist/query/index.d.ts +5 -3
  78. package/dist/query/index.js +6 -137
  79. package/dist/queryBuilder-BXDvX1K_.cjs +1123 -0
  80. package/dist/queryBuilder-CbLL4pG5.js +963 -0
  81. package/dist/queryBuilder-CbLL4pG5.js.map +1 -0
  82. package/dist/selection-BvK6yX0g.d.cts +433 -0
  83. package/dist/selection-BvK6yX0g.d.cts.map +1 -0
  84. package/dist/selection-fpmI3ADQ.d.ts +433 -0
  85. package/dist/selection-fpmI3ADQ.d.ts.map +1 -0
  86. package/dist/types/index.cjs +4 -1
  87. package/dist/types/index.d.cts +7 -2
  88. package/dist/types/index.d.ts +7 -2
  89. package/dist/types/index.js +4 -1
  90. package/dist/utils/index.cjs +4 -17
  91. package/dist/utils/index.d.cts +3 -17
  92. package/dist/utils/index.d.ts +3 -17
  93. package/dist/utils/index.js +4 -18
  94. package/package.json +26 -5
  95. package/src/actions/public/getEntity.ts +27 -43
  96. package/src/actions/public/getEntityNonce.ts +30 -0
  97. package/src/actions/public/predictEntityKeys.test.ts +143 -0
  98. package/src/actions/public/predictEntityKeys.ts +138 -0
  99. package/src/actions/public/query.ts +33 -69
  100. package/src/actions/public/watchEntityEvents.test.ts +414 -0
  101. package/src/actions/public/watchEntityEvents.ts +225 -0
  102. package/src/actions/wallet/changeOwnership.ts +8 -8
  103. package/src/actions/wallet/createEntity.ts +104 -26
  104. package/src/actions/wallet/deleteEntity.ts +2 -3
  105. package/src/actions/wallet/extendEntity.ts +39 -16
  106. package/src/actions/wallet/mutateEntities.test.ts +76 -0
  107. package/src/actions/wallet/mutateEntities.ts +29 -74
  108. package/src/actions/wallet/patchEntity.ts +90 -0
  109. package/src/attr/attributes.test.ts +120 -0
  110. package/src/attr/attributes.ts +190 -0
  111. package/src/attr/codec.test.ts +162 -0
  112. package/src/attr/codec.ts +220 -0
  113. package/src/attr/decimal.ts +86 -0
  114. package/src/attr/errors.ts +145 -0
  115. package/src/attr/index.ts +50 -0
  116. package/src/attr/names.ts +106 -0
  117. package/src/attr/types.ts +150 -0
  118. package/src/attr/values.test.ts +271 -0
  119. package/src/attr/values.ts +502 -0
  120. package/src/chains/cheesecake.ts +22 -0
  121. package/src/chains/index.ts +1 -2
  122. package/src/clients/createPublicClient.test.ts +3 -5
  123. package/src/clients/createPublicClient.ts +5 -4
  124. package/src/clients/createWalletClient.test.ts +2 -2
  125. package/src/clients/createWalletClient.ts +13 -7
  126. package/src/clients/decorators/arkivPublic.ts +160 -139
  127. package/src/clients/decorators/arkivWallet.ts +91 -95
  128. package/src/consts.ts +2 -1
  129. package/src/entity/create.test.ts +184 -0
  130. package/src/entity/errors.ts +38 -0
  131. package/src/entity/events.ts +16 -0
  132. package/src/entity/expiry.test.ts +195 -0
  133. package/src/entity/expiry.ts +181 -0
  134. package/src/entity/flags.ts +65 -0
  135. package/src/entity/index.ts +14 -0
  136. package/src/entity/key.ts +68 -0
  137. package/src/entity/operations.ts +134 -0
  138. package/src/entity/params.ts +15 -0
  139. package/src/errors.ts +33 -28
  140. package/src/index.ts +6 -0
  141. package/src/query/engine.ts +59 -134
  142. package/src/query/errors.ts +151 -0
  143. package/src/query/expression.test.ts +286 -0
  144. package/src/query/expression.ts +493 -0
  145. package/src/query/index.ts +40 -4
  146. package/src/query/injection.test.ts +151 -0
  147. package/src/query/queryBuilder.test.ts +322 -637
  148. package/src/query/queryBuilder.ts +126 -359
  149. package/src/query/queryResult.ts +54 -51
  150. package/src/query/selection.test.ts +48 -98
  151. package/src/query/selection.ts +77 -65
  152. package/src/types/entity.test.ts +44 -155
  153. package/src/types/entity.ts +62 -44
  154. package/src/types/events.ts +64 -23
  155. package/src/types/index.ts +20 -16
  156. package/src/types/rpcSchema.ts +70 -33
  157. package/src/utils/arkivTransactions.test.ts +681 -38
  158. package/src/utils/arkivTransactions.ts +249 -104
  159. package/src/utils/chains.test.ts +21 -24
  160. package/src/utils/compression.ts +1 -1
  161. package/src/utils/entities.test.ts +62 -0
  162. package/src/utils/entities.ts +111 -29
  163. package/src/utils/expirationTime.ts +114 -10
  164. package/src/utils/logger.ts +2 -2
  165. package/src/utils/payload.ts +4 -2
  166. package/src/utils/revert.test.ts +99 -0
  167. package/src/utils/revert.ts +145 -0
  168. package/dist/chains-BifaY04V.cjs +0 -108
  169. package/dist/chains-CrtkVbBh.js +0 -86
  170. package/dist/chains-CrtkVbBh.js.map +0 -1
  171. package/dist/consts-AUoL-v42.cjs +0 -18
  172. package/dist/consts-BV4PR-de.js +0 -7
  173. package/dist/consts-BV4PR-de.js.map +0 -1
  174. package/dist/entity-B6g_EPm1.d.cts +0 -382
  175. package/dist/entity-B6g_EPm1.d.cts.map +0 -1
  176. package/dist/entity-qoLMAuuk.d.ts +0 -382
  177. package/dist/entity-qoLMAuuk.d.ts.map +0 -1
  178. package/dist/index-DdspxNAA.d.ts +0 -481
  179. package/dist/index-DdspxNAA.d.ts.map +0 -1
  180. package/dist/index-Ds9dwqb5.d.cts +0 -481
  181. package/dist/index-Ds9dwqb5.d.cts.map +0 -1
  182. package/dist/payload-B2kFJyah.d.ts +0 -6
  183. package/dist/payload-B2kFJyah.d.ts.map +0 -1
  184. package/dist/payload-CJN8fTvX.d.cts +0 -6
  185. package/dist/payload-CJN8fTvX.d.cts.map +0 -1
  186. package/dist/payload-Claf2jUO.js +0 -13
  187. package/dist/payload-Claf2jUO.js.map +0 -1
  188. package/dist/payload-DpA5PA-w.cjs +0 -23
  189. package/dist/query/index.js.map +0 -1
  190. package/dist/queryBuilder-D2uwP9jI.js +0 -704
  191. package/dist/queryBuilder-D2uwP9jI.js.map +0 -1
  192. package/dist/queryBuilder-UW2MCaX4.cjs +0 -792
  193. package/dist/utils/index.d.cts.map +0 -1
  194. package/dist/utils/index.d.ts.map +0 -1
  195. package/dist/utils/index.js.map +0 -1
  196. package/src/actions/public/buildQuery.ts +0 -10
  197. package/src/actions/public/subscribeEntityEvents.ts +0 -119
  198. package/src/actions/wallet/updateEntity.ts +0 -60
  199. package/src/chains/braga.ts +0 -26
  200. package/src/chains/kaolin.ts +0 -29
  201. package/src/query/engine.test.ts +0 -526
  202. package/src/query/predicate.test.ts +0 -461
  203. package/src/query/predicate.ts +0 -144
  204. package/src/query/queryResult.test.ts +0 -270
  205. package/src/query/selectQueryBuilder.test.ts +0 -210
  206. package/src/types/attributes.ts +0 -16
  207. package/src/utils/validation.test.ts +0 -60
  208. package/src/utils/validation.ts +0 -32
  209. /package/dist/{types-H-TSmRpm.js → types-Bx1EKe0v.js} +0 -0
  210. /package/dist/{types-o3zWarRp.cjs → types-CKPddlfS.cjs} +0 -0
@@ -0,0 +1,433 @@
1
+ import { C as ValueInput, G as StrValue, R as ArkivValue, Y as UserTypeTag, h as Attributes, m as AttributeSchema } from "./index-DVYFaXNV.js";
2
+ import { n as ResolvedCreationFlags } from "./flags-wmcMoAnN.js";
3
+ import { Account, Chain, Client, Hex, RpcSchema, Transport } from "viem";
4
+
5
+ //#region src/types/rpcSchema.d.ts
6
+
7
+ /**
8
+ * An attribute as the node renders it: the name, the type **tag** (not the wire typeId), and the
9
+ * value in the JSON encoding that type prescribes — a JSON number for `i32`, a `0x` QUANTITY for
10
+ * `u64` and `u256`, a decimal string for `dec`, `0x` DATA for the byte-shaped types, and a string for
11
+ * `str`.
12
+ *
13
+ * The encoding follows the *declared type*, never the magnitude, so a decoder dispatches on `type`
14
+ * and never has to guess from the shape of the value.
15
+ */
16
+ type RpcAttribute = {
17
+ name: string;
18
+ type: string;
19
+ value: unknown;
20
+ };
21
+ /** An entry of the `attributeSchema` projection — a name and its type, with no value. */
22
+ type RpcAttributeSchemaEntry = {
23
+ name: string;
24
+ type: string;
25
+ };
26
+ /**
27
+ * The `creationFlags` projection.
28
+ */
29
+ type RpcCreationFlags = {
30
+ readonly?: boolean;
31
+ permissionlessExtension?: boolean;
32
+ raw: number;
33
+ };
34
+ /**
35
+ * An entity as `arkiv_query` returns it. Every field is present only if it was selected, so all of
36
+ * them are optional here — {@link RpcSelect} is what decides which arrive.
37
+ */
38
+ type RpcEntity = {
39
+ key?: Hex;
40
+ owner?: Hex;
41
+ creator?: Hex;
42
+ createdAt?: Hex;
43
+ updatedAt?: Hex;
44
+ expiresAt?: Hex;
45
+ creationFlags?: RpcCreationFlags | number;
46
+ contentType?: string;
47
+ payload?: Hex;
48
+ attributeSchema?: RpcAttributeSchemaEntry[];
49
+ attributes?: RpcAttribute[];
50
+ };
51
+ /**
52
+ * The `select` projection: flat, per-field booleans. Everything except `key` defaults to **off**,
53
+ * so a query asks for exactly what it needs and nothing more.
54
+ *
55
+ * `attributes` is the one field with a third form: `true` for every attribute, or a map of names
56
+ * for a subset.
57
+ */
58
+ type RpcSelect = {
59
+ key?: boolean;
60
+ owner?: boolean;
61
+ creator?: boolean;
62
+ createdAt?: boolean;
63
+ updatedAt?: boolean;
64
+ expiresAt?: boolean;
65
+ creationFlags?: boolean;
66
+ contentType?: boolean;
67
+ payload?: boolean;
68
+ attributeSchema?: boolean;
69
+ attributes?: boolean | Record<string, boolean>;
70
+ };
71
+ type RpcQueryOptions = {
72
+ /** Block height to read at, as a hex quantity. Defaults to the head, and must be within the node's retained range. */
73
+ atBlock?: Hex;
74
+ /** What to return. Defaults to `{ key: true }`. */
75
+ select?: RpcSelect;
76
+ /** Page size, as a hex quantity. Node maximum is 200. */
77
+ limit?: Hex;
78
+ /** Opaque cursor from a previous response; bound to that query, block and selection. */
79
+ cursor?: string;
80
+ };
81
+ type ArkivRpcSchema = [{
82
+ Method: "arkiv_query";
83
+ Parameters?: [query: string, queryOptions?: RpcQueryOptions];
84
+ ReturnType: {
85
+ data: RpcEntity[];
86
+ blockNumber: Hex;
87
+ /** Omitted when no pages remain. */
88
+ cursor?: string;
89
+ };
90
+ }, {
91
+ Method: "arkiv_getBlockTiming";
92
+ Parameters?: [];
93
+ ReturnType: {
94
+ current_block: bigint;
95
+ current_block_time: number;
96
+ duration: number;
97
+ };
98
+ }, {
99
+ Method: "arkiv_getEntityCount";
100
+ Parameters?: [];
101
+ ReturnType: number;
102
+ }];
103
+ //#endregion
104
+ //#region src/clients/baseClient.d.ts
105
+ 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>;
106
+ //#endregion
107
+ //#region src/types/entity.d.ts
108
+ /**
109
+ * The fields an {@link Entity} can carry. Every one is optional: a query returns exactly the parts
110
+ * it selected, and `undefined` means "not asked for" rather than "empty".
111
+ */
112
+ type EntityFields = {
113
+ key?: Hex | undefined;
114
+ owner?: Hex | undefined;
115
+ creator?: Hex | undefined;
116
+ /** Block the entity was created at. */
117
+ createdAt?: bigint | undefined;
118
+ /** Block the entity was last patched at. */
119
+ updatedAt?: bigint | undefined;
120
+ /** Block the entity expires at. */
121
+ expiresAt?: bigint | undefined;
122
+ /** The immutable properties the entity was created with. */
123
+ creationFlags?: ResolvedCreationFlags | undefined;
124
+ contentType?: string | undefined;
125
+ payload?: Uint8Array | undefined;
126
+ /** Attribute names and types, with no values. */
127
+ attributeSchema?: AttributeSchema | undefined;
128
+ /** Attribute names, types and values. */
129
+ attributes?: Attributes | undefined;
130
+ };
131
+ /**
132
+ * An entity as it comes back from a query.
133
+ *
134
+ * Which fields are populated is decided by the query's selection — `select({ key: true })` gives
135
+ * back an entity carrying only its key. The static type of a `select()` result is narrowed to
136
+ * exactly the selected fields, so in typed code the `undefined`s here are not reachable.
137
+ */
138
+ declare class Entity implements EntityFields {
139
+ key: Hex | undefined;
140
+ owner: Hex | undefined;
141
+ creator: Hex | undefined;
142
+ createdAt: bigint | undefined;
143
+ updatedAt: bigint | undefined;
144
+ expiresAt: bigint | undefined;
145
+ creationFlags: ResolvedCreationFlags | undefined;
146
+ contentType: string | undefined;
147
+ payload: Uint8Array | undefined;
148
+ attributeSchema: AttributeSchema | undefined;
149
+ attributes: Attributes | undefined;
150
+ constructor(fields?: EntityFields);
151
+ /**
152
+ * The payload decoded as UTF-8 text.
153
+ *
154
+ * @throws If the payload was not selected, or is not valid UTF-8.
155
+ */
156
+ toText(): string;
157
+ /**
158
+ * The payload parsed as JSON.
159
+ *
160
+ * @throws If the payload was not selected, is empty, or is not valid JSON.
161
+ */
162
+ toJson(): any;
163
+ }
164
+ //#endregion
165
+ //#region src/query/expression.d.ts
166
+ type ComparisonOperator = "=" | "!=" | "<" | "<=" | ">" | ">=";
167
+ /** A comparison between an attribute and a typed literal. */
168
+ type ComparisonNode = {
169
+ readonly kind: "comparison";
170
+ readonly name: string;
171
+ readonly operator: ComparisonOperator;
172
+ readonly value: ArkivValue;
173
+ };
174
+ /** A `STARTSWITH` prefix test, the language's only pattern operator. */
175
+ type StartsWithNode = {
176
+ readonly kind: "startsWith";
177
+ readonly name: string;
178
+ readonly value: StrValue;
179
+ };
180
+ /** An `EXISTS(name)` test — true when the attribute is set with any type. */
181
+ type ExistsNode = {
182
+ readonly kind: "exists";
183
+ readonly name: string;
184
+ };
185
+ /** A `TYPEOF(name) = tag` test. */
186
+ type TypeOfNode = {
187
+ readonly kind: "typeOf";
188
+ readonly name: string;
189
+ readonly tag: UserTypeTag;
190
+ };
191
+ /** The complement of an expression, evaluated against the active-entity set. */
192
+ type NotNode = {
193
+ readonly kind: "not";
194
+ readonly expression: Expression;
195
+ };
196
+ /** A conjunction. */
197
+ type AndNode = {
198
+ readonly kind: "and";
199
+ readonly expressions: readonly Expression[];
200
+ };
201
+ /** A disjunction. */
202
+ type OrNode = {
203
+ readonly kind: "or";
204
+ readonly expressions: readonly Expression[];
205
+ };
206
+ /**
207
+ * A query expression: an immutable tree built by the combinators below, whose `toString()` is the
208
+ * exact query string sent over the wire.
209
+ *
210
+ * @example
211
+ * const q = and(gte("level", i32(10)), or(eq("status", str("open")), not(exists("closedAt"))))
212
+ * String(q) // level >= i32(10) AND (status = str('open') OR NOT EXISTS(closedAt))
213
+ */
214
+ type Expression = ComparisonNode | StartsWithNode | ExistsNode | TypeOfNode | NotNode | AndNode | OrNode;
215
+ /**
216
+ * Attribute equals value — set with this exact type, and holding this value.
217
+ *
218
+ * Bare booleans, numbers, bigints and strings take the same default types they take when written
219
+ * (`number` is an `i32`, `bigint` a `u256`, `string` a `str`); anything else names its type.
220
+ *
221
+ * @throws {InvalidPredicateError} If the name is not a queryable attribute, or a system attribute
222
+ * is compared against the wrong type.
223
+ *
224
+ * @example
225
+ * eq("status", str("open")) // status = str('open')
226
+ * eq("flagged", true) // flagged = true
227
+ * eq("$owner", addr(account)) // $owner = addr(0xd8dA…)
228
+ */
229
+ declare function eq(name: string, value: ValueInput): ComparisonNode;
230
+ /**
231
+ * Attribute is set with this type and holds a **different** value.
232
+ *
233
+ * This is typed value-negation, not the complement: an entity that never set the attribute, or set
234
+ * it with another type, does not match. Use `not(eq(...))` for the full complement.
235
+ *
236
+ * @example
237
+ * ne("status", str("closed")) // status != str('closed')
238
+ * not(eq("status", str("closed"))) // NOT status = str('closed') — also matches entities with no status
239
+ */
240
+ declare function ne(name: string, value: ValueInput): ComparisonNode;
241
+ /**
242
+ * Attribute is greater than value. Ordered types only (`i32`, `u256`, `dec`).
243
+ *
244
+ * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
245
+ *
246
+ * @example
247
+ * gt("level", i32(10)) // level > i32(10)
248
+ * gt("$expiresAt", u64(1_200_000n)) // $expiresAt > u64(1200000)
249
+ */
250
+ declare function gt(name: string, value: ValueInput): ComparisonNode;
251
+ /**
252
+ * Attribute is greater than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
253
+ *
254
+ * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
255
+ *
256
+ * @example
257
+ * gte("score", dec("3.5")) // score >= dec(3.5)
258
+ */
259
+ declare function gte(name: string, value: ValueInput): ComparisonNode;
260
+ /**
261
+ * Attribute is less than value. Ordered types only (`i32`, `u256`, `dec`).
262
+ *
263
+ * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
264
+ *
265
+ * @example
266
+ * lt("level", i32(10)) // level < i32(10)
267
+ */
268
+ declare function lt(name: string, value: ValueInput): ComparisonNode;
269
+ /**
270
+ * Attribute is less than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
271
+ *
272
+ * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
273
+ *
274
+ * @example
275
+ * lte("score", dec("5")) // score <= dec(5)
276
+ */
277
+ declare function lte(name: string, value: ValueInput): ComparisonNode;
278
+ /**
279
+ * Attribute is a `str` beginning with this prefix.
280
+ *
281
+ * The match is on **raw UTF-8 bytes** with no normalization — it is the index encoding, so
282
+ * `startsWith("name", "é")` matches only the same byte sequence, not another normal form of it.
283
+ *
284
+ * @param prefix - The prefix, as a bare string or a `str` value.
285
+ * @throws {UnsupportedOperatorError} If given a value that is not a `str`.
286
+ *
287
+ * @example
288
+ * startsWith("desc", "ab") // desc STARTSWITH str('ab')
289
+ */
290
+ declare function startsWith(name: string, prefix: string | StrValue): StartsWithNode;
291
+ /**
292
+ * The attribute is set, with any type.
293
+ *
294
+ * @throws {InvalidPredicateError} If given a system attribute — every entity has all of them, so
295
+ * the test would be a constant.
296
+ *
297
+ * @example
298
+ * exists("reviewedBy") // EXISTS(reviewedBy)
299
+ * not(exists("closedAt")) // NOT EXISTS(closedAt)
300
+ */
301
+ declare function exists(name: string): ExistsNode;
302
+ /**
303
+ * The attribute is set with exactly this type, whatever its value.
304
+ *
305
+ * Useful when the same name is written with different types across entities — a comparison already
306
+ * asserts the type, so this is for asking about the type alone.
307
+ *
308
+ * @param tag - The type tag: `bool`, `i32`, `u256`, `dec`, `bytes32`, `str`, `addr` or `key`.
309
+ * @throws {InvalidPredicateError} If the tag is not a settable type, or the name is a system
310
+ * attribute (whose type is fixed).
311
+ *
312
+ * @example
313
+ * hasType("age", "i32") // TYPEOF(age) = i32
314
+ */
315
+ declare function hasType(name: string, tag: UserTypeTag): TypeOfNode;
316
+ /**
317
+ * The complement of an expression, evaluated against the set of live entities — unlike `!=`, it
318
+ * matches entities that never set the attribute at all.
319
+ *
320
+ * @example
321
+ * not(exists("closedAt")) // NOT EXISTS(closedAt)
322
+ * not(and(eq("a", 1), eq("b", 2))) // NOT (a = i32(1) AND b = i32(2))
323
+ */
324
+ declare function not(expression: Expression): NotNode;
325
+ /**
326
+ * All of these must hold.
327
+ *
328
+ * A single expression is returned unwrapped, so building a conjunction from a filtered list does
329
+ * not litter the query with redundant nesting.
330
+ *
331
+ * @param expressions - The expressions, as separate arguments or one array.
332
+ * @throws {InvalidPredicateError} If given nothing to combine.
333
+ *
334
+ * @example
335
+ * and(gte("level", i32(10)), eq("status", "open"))
336
+ * and(filters) // an array works too
337
+ */
338
+ declare function and(expressions: readonly Expression[]): Expression;
339
+ declare function and(...expressions: Expression[]): Expression;
340
+ /**
341
+ * At least one of these must hold.
342
+ *
343
+ * A single expression is returned unwrapped.
344
+ *
345
+ * @param expressions - The expressions, as separate arguments or one array.
346
+ * @throws {InvalidPredicateError} If given nothing to combine.
347
+ *
348
+ * @example
349
+ * or(eq("status", "open"), not(exists("closedAt")))
350
+ */
351
+ declare function or(expressions: readonly Expression[]): Expression;
352
+ declare function or(...expressions: Expression[]): Expression;
353
+ /**
354
+ * Renders an expression as the query string the node parses. Equivalent to `String(expression)`.
355
+ *
356
+ * Literals are always written tagged, even where the language would infer them: an untagged number
357
+ * defaults to `i32`, but spelling it `i32(10)` keeps the exact-type assertion visible in the query
358
+ * that actually went over the wire.
359
+ */
360
+ declare function render(expression: Expression): string;
361
+ //#endregion
362
+ //#region src/query/selection.d.ts
363
+ /**
364
+ * The entity fields a query can select. Each maps one-to-one onto a field of {@link Entity}.
365
+ *
366
+ * `attributes` takes a third form beyond `true`/`false`: a map of names, to fetch only those.
367
+ */
368
+ type SelectionFields = {
369
+ key?: boolean;
370
+ owner?: boolean;
371
+ creator?: boolean;
372
+ createdAt?: boolean;
373
+ updatedAt?: boolean;
374
+ expiresAt?: boolean;
375
+ creationFlags?: boolean;
376
+ contentType?: boolean;
377
+ payload?: boolean;
378
+ /** Attribute names and types, without their values. */
379
+ attributeSchema?: boolean;
380
+ /** `true` for every attribute, or a map of names for a subset. */
381
+ attributes?: boolean | Readonly<Record<string, boolean>>;
382
+ };
383
+ /** The selection keys, in the order they are written into the RPC `select` object. */
384
+ declare const SELECTION_KEYS: readonly ["key", "owner", "creator", "createdAt", "updatedAt", "expiresAt", "creationFlags", "contentType", "payload", "attributeSchema", "attributes"];
385
+ /**
386
+ * Requires at least one property of `T` to be present.
387
+ * `{}` is not assignable, which is how `select({})` is rejected at compile time.
388
+ */
389
+ type AtLeastOne<T, K$1 extends keyof T = keyof T> = { [P in K$1]: Required<Pick<T, P>> & Partial<Omit<T, P>> }[K$1];
390
+ /**
391
+ * A non-empty entity selection — the object form accepted by `select()`. At least one field must be
392
+ * selected.
393
+ */
394
+ type EntitySelection = AtLeastOne<SelectionFields>;
395
+ /** Argument accepted by `select()` — a non-empty {@link EntitySelection}, or `"*"` for everything. */
396
+ type SelectArg = EntitySelection | "*";
397
+ /** Whether a selection value asks for the field: `true`, or a non-empty map of attribute names. */
398
+ type Selected<V> = V extends false | undefined ? false : true;
399
+ /**
400
+ * The result of a selection `S`: an {@link Entity} narrowed to exactly the selected fields (each
401
+ * non-`undefined`). The shape is flat — `select({ owner: true })` yields `{ owner: Hex }`, read as
402
+ * `entity.owner`. Accessing an unselected field is a compile error.
403
+ *
404
+ * `toText()` / `toJson()` operate on the payload, so they appear only when `payload` was selected —
405
+ * calling them otherwise would always throw.
406
+ */
407
+ type ProjectedEntity<S> = { readonly [K in keyof S as Selected<S[K]> extends true ? K : never]: K extends keyof Entity ? NonNullable<Entity[K]> : never } & (S extends {
408
+ payload: true;
409
+ } ? Pick<Entity, "toText" | "toJson"> : unknown);
410
+ /** A selection of every field, used to type the result of `select()` / `select("*")`. */
411
+ type AllSelected = { [K in (typeof SELECTION_KEYS)[number]]: true };
412
+ /** The projected entity type when everything is selected — every field, plus the methods. */
413
+ type FullEntity = ProjectedEntity<AllSelected>;
414
+ /**
415
+ * Converts a {@link SelectArg} into the RPC `select` object.
416
+ *
417
+ * Every field is opt-in — anything not explicitly selected is sent as `false`, including the key.
418
+ * Sending the full object rather than omitting the `false`s keeps what the SDK asked for legible in
419
+ * a request log, and pins the answer even if a node's defaults change.
420
+ *
421
+ * `undefined` or `"*"` selects everything.
422
+ *
423
+ * @throws If the selection asks for nothing.
424
+ *
425
+ * @example
426
+ * toRpcSelect() // everything
427
+ * toRpcSelect({ key: true }) // only the key
428
+ * toRpcSelect({ attributes: { projectId: true } }) // one named attribute
429
+ */
430
+ declare function toRpcSelect(selection?: SelectArg): RpcSelect;
431
+ //#endregion
432
+ export { EntityFields as A, lte as C, render as D, or as E, RpcCreationFlags as F, RpcEntity as I, RpcQueryOptions as L, ArkivRpcSchema as M, RpcAttribute as N, startsWith as O, RpcAttributeSchemaEntry as P, RpcSelect as R, lt as S, not as T, eq as _, SelectionFields as a, gte as b, ComparisonNode as c, Expression as d, NotNode as f, and as g, TypeOfNode as h, SelectArg as i, ArkivClient as j, Entity as k, ComparisonOperator as l, StartsWithNode as m, FullEntity as n, toRpcSelect as o, OrNode as p, ProjectedEntity as r, AndNode as s, EntitySelection as t, ExistsNode as u, exists as v, ne as w, hasType as x, gt as y };
433
+ //# sourceMappingURL=selection-fpmI3ADQ.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection-fpmI3ADQ.d.ts","names":[],"sources":["../src/types/rpcSchema.ts","../src/clients/baseClient.ts","../src/types/entity.ts","../src/query/expression.ts","../src/query/selection.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAWA;AAOA;AAQA;AAUA;;AAEU,KA3BE,YAAA,GA2BF;EACE,IAAA,EAAA,MAAA;EACE,IAAA,EAAA,MAAA;EACA,KAAA,EAAA,OAAA;CACA;;AAGF,KA3BA,uBAAA,GA2B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SAAA,KAAA,GAAA,SAAA,GAAA,KAAA,GAAA,IAAA;;;;;;;;;AAEjB,KG4DE,eH5DF,CAAA,CAAA,CAAA,GAAA,uBG6Da,KAAK,SAAS,EAAE,mBAAmB,YAAY,gBAAgB,SAChF,YAAY,OAAO,iBAEpB;;AFhEL,CAAA,GEgEmC,IFhEvB,CEgE4B,MFhE5B,EAAA,QAAY,GAAA,QAAA,CAAA,GAAA,OAAA,CAAA;;KEmEnB,WAAA,GFjEK,QACE,CAAA,OEgEuB,cFhEvB,CAAA,CAAA,MAAA,CAAA,GAAA,IAAA,EAQM;;AAIE,KEuDR,UAAA,GAAa,eFvDL,CEuDqB,WFvDrB,CAAA;;;AAYpB;;;;;;;;;;;;;;ACrBY,iBCkFI,WAAA,CDlFc,SAAA,CAAA,ECkFU,SDlFV,CAAA,ECkFsB,SDlFtB"}
@@ -1 +1,4 @@
1
- require('../types-o3zWarRp.cjs');
1
+ const require_entity = require('../entity-B0t6sN7F.cjs');
2
+ require('../types-CKPddlfS.cjs');
3
+
4
+ exports.Entity = require_entity.Entity;
@@ -1,2 +1,7 @@
1
- import { A as RpcIncludeData, C as QueryOptionsIncludeData, E as GetBlockTimingReturnType, M as RpcQueryOptions, N as MimeType, O as ArkivRpcSchema, S as QueryOptions, T as QueryReturnType, _ as DeleteEntityReturnType, a as OnEntityExpiredEvent, b as ChangeOwnershipParameters, c as OnEntityUpdatedEvent, d as MutateEntitiesReturnType, f as UpdateEntityParameters, g as DeleteEntityParameters, h as ExtendEntityReturnType, i as OnEntityDeletedEvent, j as RpcOrderByAttribute, k as RpcEntity, l as Attribute, m as ExtendEntityParameters, n as TxParams, o as OnEntityExpiresInExtendedEvent, p as UpdateEntityReturnType, r as OnEntityCreatedEvent, s as OnEntityOwnerChangedEvent, t as Entity, u as MutateEntitiesParameters, v as CreateEntityParameters, w as QueryOptionsOrderBy, x as ChangeOwnershipReturnType, y as CreateEntityReturnType } from "../entity-B6g_EPm1.cjs";
2
- export { ArkivRpcSchema, Attribute, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OnEntityCreatedEvent, OnEntityDeletedEvent, OnEntityExpiredEvent, OnEntityExpiresInExtendedEvent, OnEntityOwnerChangedEvent, OnEntityUpdatedEvent, QueryOptions, QueryOptionsIncludeData, QueryOptionsOrderBy, QueryReturnType, RpcEntity, RpcIncludeData, RpcOrderByAttribute, RpcQueryOptions, TxParams, UpdateEntityParameters, UpdateEntityReturnType };
1
+ import "../index-D8LZt-3J.cjs";
2
+ import "../index-D0CmtiWT.cjs";
3
+ import "../expiry-DRV29F1r.cjs";
4
+ import "../flags-0Vl5rrHq.cjs";
5
+ import { A as EntityFields, F as RpcCreationFlags, I as RpcEntity, L as RpcQueryOptions, M as ArkivRpcSchema, N as RpcAttribute, P as RpcAttributeSchemaEntry, R as RpcSelect, k as Entity } from "../selection-BvK6yX0g.cjs";
6
+ import { C as OwnershipTransferredEvent, D as PredictEntityKeysReturnType, E as PredictEntityKeysParameters, O as PredictedEntityKey, S as ExpiryExtendedEvent, T as QueryReturnType, _ as EntityCreatedEvent, a as MutateEntitiesParameters, b as EntityEventContext, c as PatchEntityReturnType, d as DeleteEntityParameters, f as DeleteEntityReturnType, g as WatchEntityEventsParameters, h as GetBlockTimingReturnType, i as MimeType, l as ExtendEntityParameters, m as CreateEntityReturnType, n as ChangeOwnershipReturnType, o as MutateEntitiesReturnType, p as CreateEntityParameters, r as TxParams, s as PatchEntityParameters, t as ChangeOwnershipParameters, u as ExtendEntityReturnType, v as EntityDeletedEvent, w as QueryOptions, x as EntityPatchedEvent, y as EntityEvent } from "../changeOwnership-B7bEgla4.cjs";
7
+ export { ArkivRpcSchema, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, EntityCreatedEvent, EntityDeletedEvent, EntityEvent, EntityEventContext, EntityFields, EntityPatchedEvent, ExpiryExtendedEvent, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OwnershipTransferredEvent, PatchEntityParameters, PatchEntityReturnType, PredictEntityKeysParameters, PredictEntityKeysReturnType, PredictedEntityKey, QueryOptions, QueryReturnType, RpcAttribute, RpcAttributeSchemaEntry, RpcCreationFlags, RpcEntity, RpcQueryOptions, RpcSelect, TxParams, WatchEntityEventsParameters };
@@ -1,2 +1,7 @@
1
- import { A as RpcIncludeData, C as QueryOptionsIncludeData, E as GetBlockTimingReturnType, M as RpcQueryOptions, N as MimeType, O as ArkivRpcSchema, S as QueryOptions, T as QueryReturnType, _ as DeleteEntityReturnType, a as OnEntityExpiredEvent, b as ChangeOwnershipParameters, c as OnEntityUpdatedEvent, d as MutateEntitiesReturnType, f as UpdateEntityParameters, g as DeleteEntityParameters, h as ExtendEntityReturnType, i as OnEntityDeletedEvent, j as RpcOrderByAttribute, k as RpcEntity, l as Attribute, m as ExtendEntityParameters, n as TxParams, o as OnEntityExpiresInExtendedEvent, p as UpdateEntityReturnType, r as OnEntityCreatedEvent, s as OnEntityOwnerChangedEvent, t as Entity, u as MutateEntitiesParameters, v as CreateEntityParameters, w as QueryOptionsOrderBy, x as ChangeOwnershipReturnType, y as CreateEntityReturnType } from "../entity-qoLMAuuk.js";
2
- export { ArkivRpcSchema, Attribute, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OnEntityCreatedEvent, OnEntityDeletedEvent, OnEntityExpiredEvent, OnEntityExpiresInExtendedEvent, OnEntityOwnerChangedEvent, OnEntityUpdatedEvent, QueryOptions, QueryOptionsIncludeData, QueryOptionsOrderBy, QueryReturnType, RpcEntity, RpcIncludeData, RpcOrderByAttribute, RpcQueryOptions, TxParams, UpdateEntityParameters, UpdateEntityReturnType };
1
+ import "../index-DVYFaXNV.js";
2
+ import "../index-ClgIuxJ8.js";
3
+ import "../expiry-BxOlvVWC.js";
4
+ import "../flags-wmcMoAnN.js";
5
+ import { A as EntityFields, F as RpcCreationFlags, I as RpcEntity, L as RpcQueryOptions, M as ArkivRpcSchema, N as RpcAttribute, P as RpcAttributeSchemaEntry, R as RpcSelect, k as Entity } from "../selection-fpmI3ADQ.js";
6
+ import { C as OwnershipTransferredEvent, D as PredictEntityKeysReturnType, E as PredictEntityKeysParameters, O as PredictedEntityKey, S as ExpiryExtendedEvent, T as QueryReturnType, _ as EntityCreatedEvent, a as MutateEntitiesParameters, b as EntityEventContext, c as PatchEntityReturnType, d as DeleteEntityParameters, f as DeleteEntityReturnType, g as WatchEntityEventsParameters, h as GetBlockTimingReturnType, i as MimeType, l as ExtendEntityParameters, m as CreateEntityReturnType, n as ChangeOwnershipReturnType, o as MutateEntitiesReturnType, p as CreateEntityParameters, r as TxParams, s as PatchEntityParameters, t as ChangeOwnershipParameters, u as ExtendEntityReturnType, v as EntityDeletedEvent, w as QueryOptions, x as EntityPatchedEvent, y as EntityEvent } from "../changeOwnership-DwgtdSFc.js";
7
+ export { ArkivRpcSchema, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, EntityCreatedEvent, EntityDeletedEvent, EntityEvent, EntityEventContext, EntityFields, EntityPatchedEvent, ExpiryExtendedEvent, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, MutateEntitiesParameters, MutateEntitiesReturnType, OwnershipTransferredEvent, PatchEntityParameters, PatchEntityReturnType, PredictEntityKeysParameters, PredictEntityKeysReturnType, PredictedEntityKey, QueryOptions, QueryReturnType, RpcAttribute, RpcAttributeSchemaEntry, RpcCreationFlags, RpcEntity, RpcQueryOptions, RpcSelect, TxParams, WatchEntityEventsParameters };
@@ -1 +1,4 @@
1
- import "../types-H-TSmRpm.js";
1
+ import { t as Entity } from "../entity-BIp_df9u.js";
2
+ import "../types-Bx1EKe0v.js";
3
+
4
+ export { Entity };
@@ -1,20 +1,7 @@
1
- const require_consts = require('../consts-AUoL-v42.cjs');
2
- const require_payload = require('../payload-DpA5PA-w.cjs');
1
+ require('../errors-D-eJkGVc.cjs');
2
+ require('../expiry-BUYIXTGb.cjs');
3
+ const require_payload = require('../payload-Bnw1hrvb.cjs');
3
4
 
4
- //#region src/utils/expirationTime.ts
5
- const ExpirationTime = {
6
- fromSeconds: (seconds) => seconds,
7
- fromMinutes: (minutes) => minutes * 60,
8
- fromHours: (hours) => hours * 60 * 60,
9
- fromDays: (days) => days * 24 * 60 * 60,
10
- fromWeeks: (weeks) => weeks * 7 * 24 * 60 * 60,
11
- fromMonths: (months) => months * 30 * 24 * 60 * 60,
12
- fromYears: (years) => years * 365 * 24 * 60 * 60,
13
- fromBlocks: (blocks) => blocks * require_consts.BLOCK_TIME,
14
- fromDate: (date) => Math.floor(date.getTime() / 1e3) - Math.floor(Date.now() / 1e3)
15
- };
16
-
17
- //#endregion
18
- exports.ExpirationTime = ExpirationTime;
5
+ exports.ExpirationTime = require_payload.ExpirationTime;
19
6
  exports.jsonToPayload = require_payload.jsonToPayload;
20
7
  exports.stringToPayload = require_payload.stringToPayload;
@@ -1,17 +1,3 @@
1
- import { n as stringToPayload, t as jsonToPayload } from "../payload-CJN8fTvX.cjs";
2
-
3
- //#region src/utils/expirationTime.d.ts
4
- declare const ExpirationTime: {
5
- fromSeconds: (seconds: number) => number;
6
- fromMinutes: (minutes: number) => number;
7
- fromHours: (hours: number) => number;
8
- fromDays: (days: number) => number;
9
- fromWeeks: (weeks: number) => number;
10
- fromMonths: (months: number) => number;
11
- fromYears: (years: number) => number;
12
- fromBlocks: (blocks: number) => number;
13
- fromDate: (date: Date) => number;
14
- };
15
- //#endregion
16
- export { ExpirationTime, jsonToPayload, stringToPayload };
17
- //# sourceMappingURL=index.d.cts.map
1
+ import "../expiry-DRV29F1r.cjs";
2
+ import { i as ExpirationTime, n as stringToPayload, r as DeadlineOptions, t as jsonToPayload } from "../payload-P0nWyjLg.cjs";
3
+ export { DeadlineOptions, ExpirationTime, jsonToPayload, stringToPayload };
@@ -1,17 +1,3 @@
1
- import { n as stringToPayload, t as jsonToPayload } from "../payload-B2kFJyah.js";
2
-
3
- //#region src/utils/expirationTime.d.ts
4
- declare const ExpirationTime: {
5
- fromSeconds: (seconds: number) => number;
6
- fromMinutes: (minutes: number) => number;
7
- fromHours: (hours: number) => number;
8
- fromDays: (days: number) => number;
9
- fromWeeks: (weeks: number) => number;
10
- fromMonths: (months: number) => number;
11
- fromYears: (years: number) => number;
12
- fromBlocks: (blocks: number) => number;
13
- fromDate: (date: Date) => number;
14
- };
15
- //#endregion
16
- export { ExpirationTime, jsonToPayload, stringToPayload };
17
- //# sourceMappingURL=index.d.ts.map
1
+ import "../expiry-BxOlvVWC.js";
2
+ import { i as ExpirationTime, n as stringToPayload, r as DeadlineOptions, t as jsonToPayload } from "../payload-Dgx3PQeK.js";
3
+ export { DeadlineOptions, ExpirationTime, jsonToPayload, stringToPayload };
@@ -1,19 +1,5 @@
1
- import { n as BLOCK_TIME } from "../consts-BV4PR-de.js";
2
- import { n as stringToPayload, t as jsonToPayload } from "../payload-Claf2jUO.js";
1
+ import "../errors-DGB8AgT2.js";
2
+ import "../expiry-DGRzrSan.js";
3
+ import { n as stringToPayload, r as ExpirationTime, t as jsonToPayload } from "../payload-CIxSn_DW.js";
3
4
 
4
- //#region src/utils/expirationTime.ts
5
- const ExpirationTime = {
6
- fromSeconds: (seconds) => seconds,
7
- fromMinutes: (minutes) => minutes * 60,
8
- fromHours: (hours) => hours * 60 * 60,
9
- fromDays: (days) => days * 24 * 60 * 60,
10
- fromWeeks: (weeks) => weeks * 7 * 24 * 60 * 60,
11
- fromMonths: (months) => months * 30 * 24 * 60 * 60,
12
- fromYears: (years) => years * 365 * 24 * 60 * 60,
13
- fromBlocks: (blocks) => blocks * BLOCK_TIME,
14
- fromDate: (date) => Math.floor(date.getTime() / 1e3) - Math.floor(Date.now() / 1e3)
15
- };
16
-
17
- //#endregion
18
- export { ExpirationTime, jsonToPayload, stringToPayload };
19
- //# sourceMappingURL=index.js.map
5
+ export { ExpirationTime, jsonToPayload, stringToPayload };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkiv-network/sdk",
3
- "version": "0.7.0",
3
+ "version": "0.8.0-dev.1",
4
4
  "description": "TypeScript client library for Arkiv's blockchains interactions",
5
5
  "type": "module",
6
6
  "target": "esnext",
@@ -15,6 +15,18 @@
15
15
  "require": "./dist/index.cjs",
16
16
  "default": "./dist/index.js"
17
17
  },
18
+ "./attr": {
19
+ "bun": "./src/attr/index.ts",
20
+ "import": "./dist/attr/index.js",
21
+ "require": "./dist/attr/index.cjs",
22
+ "default": "./dist/attr/index.js"
23
+ },
24
+ "./entity": {
25
+ "bun": "./src/entity/index.ts",
26
+ "import": "./dist/entity/index.js",
27
+ "require": "./dist/entity/index.cjs",
28
+ "default": "./dist/entity/index.js"
29
+ },
18
30
  "./chains": {
19
31
  "bun": "./src/chains/index.ts",
20
32
  "import": "./dist/chains/index.js",
@@ -43,14 +55,23 @@
43
55
  },
44
56
  "typesVersions": {
45
57
  "*": {
58
+ "attr": [
59
+ "./dist/attr/index.d.ts"
60
+ ],
46
61
  "chains": [
47
- "./dist/_types/chains/index.d.ts"
62
+ "./dist/chains/index.d.ts"
48
63
  ],
49
- "utils": [
50
- "./dist/_types/utils/index.d.ts"
64
+ "entity": [
65
+ "./dist/entity/index.d.ts"
51
66
  ],
52
67
  "query": [
53
- "./dist/_types/query/index.d.ts"
68
+ "./dist/query/index.d.ts"
69
+ ],
70
+ "types": [
71
+ "./dist/types/index.d.ts"
72
+ ],
73
+ "utils": [
74
+ "./dist/utils/index.d.ts"
54
75
  ]
55
76
  }
56
77
  },