@arkiv-network/sdk 0.8.0-dev.1 → 0.8.0-dev.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 (134) hide show
  1. package/dist/attr/index.cjs +1 -1
  2. package/dist/attr/index.d.cts +1 -1
  3. package/dist/attr/index.d.ts +1 -1
  4. package/dist/attr/index.js +1 -1
  5. package/dist/{attr-BvxHN99W.cjs → attr-BXTkpnoc.cjs} +13 -3
  6. package/dist/{attr-BDZ-APg5.js → attr-tmyREHtw.js} +14 -4
  7. package/dist/attr-tmyREHtw.js.map +1 -0
  8. package/dist/chains/index.cjs +1 -1
  9. package/dist/chains/index.d.cts +3 -0
  10. package/dist/chains/index.d.cts.map +1 -1
  11. package/dist/chains/index.d.ts +3 -0
  12. package/dist/chains/index.d.ts.map +1 -1
  13. package/dist/chains/index.js +1 -1
  14. package/dist/{chains-BYRTTipa.cjs → chains-BfNQliHU.cjs} +3 -0
  15. package/dist/{chains-BJrZs6sG.js → chains-Du8tql7I.js} +4 -1
  16. package/dist/chains-Du8tql7I.js.map +1 -0
  17. package/dist/{changeOwnership-DwgtdSFc.d.ts → changeOwnership-B0ar96ub.d.ts} +47 -34
  18. package/dist/changeOwnership-B0ar96ub.d.ts.map +1 -0
  19. package/dist/{changeOwnership-B7bEgla4.d.cts → changeOwnership-BofkLnXJ.d.cts} +47 -34
  20. package/dist/changeOwnership-BofkLnXJ.d.cts.map +1 -0
  21. package/dist/entity/index.cjs +5 -4
  22. package/dist/entity/index.d.cts +2 -2
  23. package/dist/entity/index.d.ts +2 -2
  24. package/dist/entity/index.js +5 -5
  25. package/dist/{entity-CFhbAv0R.js → entity-CniBgBSd.js} +17 -5
  26. package/dist/entity-CniBgBSd.js.map +1 -0
  27. package/dist/{entity-wfBnZd91.cjs → entity-DJ0Gml9c.cjs} +23 -5
  28. package/dist/{errors-DGB8AgT2.js → errors-D2E1GRjw.js} +2 -2
  29. package/dist/errors-D2E1GRjw.js.map +1 -0
  30. package/dist/{errors-D-eJkGVc.cjs → errors-DhV00966.cjs} +1 -1
  31. package/dist/expiry-BxOlvVWC.d.ts.map +1 -1
  32. package/dist/{expiry-BUYIXTGb.cjs → expiry-CG9GhVXv.cjs} +1 -1
  33. package/dist/{expiry-DGRzrSan.js → expiry-Cgdb_dbq.js} +2 -2
  34. package/dist/expiry-Cgdb_dbq.js.map +1 -0
  35. package/dist/expiry-DRV29F1r.d.cts.map +1 -1
  36. package/dist/{flags-Ct8k0gpB.cjs → flags-DCD26uhe.cjs} +1 -1
  37. package/dist/{flags-ZtlvOIIk.js → flags-DUT2gHEU.js} +2 -2
  38. package/dist/{flags-ZtlvOIIk.js.map → flags-DUT2gHEU.js.map} +1 -1
  39. package/dist/{index-D0CmtiWT.d.cts → index-BGp2plHs.d.cts} +15 -5
  40. package/dist/index-BGp2plHs.d.cts.map +1 -0
  41. package/dist/{index-VCqgn29D.d.ts → index-BKB875Um.d.ts} +4 -4
  42. package/dist/{index-VCqgn29D.d.ts.map → index-BKB875Um.d.ts.map} +1 -1
  43. package/dist/{index-DVYFaXNV.d.ts → index-CIcHPx2j.d.cts} +13 -6
  44. package/dist/index-CIcHPx2j.d.cts.map +1 -0
  45. package/dist/{index-D8LZt-3J.d.cts → index-Cd2aaWme.d.ts} +13 -6
  46. package/dist/index-Cd2aaWme.d.ts.map +1 -0
  47. package/dist/{index-ClgIuxJ8.d.ts → index-ezMZ2-JH.d.ts} +15 -5
  48. package/dist/index-ezMZ2-JH.d.ts.map +1 -0
  49. package/dist/{index-Cgw1u5aY.d.cts → index-rINthNuU.d.cts} +4 -4
  50. package/dist/{index-Cgw1u5aY.d.cts.map → index-rINthNuU.d.cts.map} +1 -1
  51. package/dist/index.cjs +41 -42
  52. package/dist/index.d.cts +56 -50
  53. package/dist/index.d.cts.map +1 -1
  54. package/dist/index.d.ts +56 -50
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +41 -43
  57. package/dist/index.js.map +1 -1
  58. package/dist/{payload-Dgx3PQeK.d.ts → payload-CGvVPZQX.d.ts} +60 -1
  59. package/dist/payload-CGvVPZQX.d.ts.map +1 -0
  60. package/dist/{payload-CIxSn_DW.js → payload-DE7wMztL.js} +28 -3
  61. package/dist/payload-DE7wMztL.js.map +1 -0
  62. package/dist/{payload-P0nWyjLg.d.cts → payload-Dfu30njp.d.cts} +60 -1
  63. package/dist/payload-Dfu30njp.d.cts.map +1 -0
  64. package/dist/{payload-Bnw1hrvb.cjs → payload-DqFweqiO.cjs} +27 -2
  65. package/dist/query/index.cjs +4 -4
  66. package/dist/query/index.d.cts +3 -3
  67. package/dist/query/index.d.ts +3 -3
  68. package/dist/query/index.js +4 -4
  69. package/dist/{queryBuilder-CbLL4pG5.js → queryBuilder-wvA8sn--.js} +14 -11
  70. package/dist/queryBuilder-wvA8sn--.js.map +1 -0
  71. package/dist/{queryBuilder-BXDvX1K_.cjs → queryBuilder-zHGhDmaG.cjs} +13 -10
  72. package/dist/{selection-BvK6yX0g.d.cts → selection-Bv8_o-7i.d.cts} +16 -8
  73. package/dist/selection-Bv8_o-7i.d.cts.map +1 -0
  74. package/dist/{selection-fpmI3ADQ.d.ts → selection-ox7zdtVm.d.ts} +16 -8
  75. package/dist/selection-ox7zdtVm.d.ts.map +1 -0
  76. package/dist/types/index.d.cts +5 -5
  77. package/dist/types/index.d.ts +5 -5
  78. package/dist/utils/index.cjs +3 -3
  79. package/dist/utils/index.d.cts +1 -1
  80. package/dist/utils/index.d.ts +1 -1
  81. package/dist/utils/index.js +3 -3
  82. package/package.json +1 -5
  83. package/src/actions/public/getEntity.ts +1 -0
  84. package/src/actions/public/predictEntityKeys.test.ts +17 -1
  85. package/src/actions/public/predictEntityKeys.ts +28 -14
  86. package/src/actions/wallet/createEntity.ts +7 -6
  87. package/src/actions/wallet/{mutateEntities.test.ts → executeBatch.test.ts} +7 -7
  88. package/src/actions/wallet/{mutateEntities.ts → executeBatch.ts} +9 -9
  89. package/src/actions/wallet/extendEntity.ts +1 -0
  90. package/src/actions/wallet/patchEntity.ts +3 -3
  91. package/src/attr/attributes.ts +8 -2
  92. package/src/attr/errors.ts +2 -2
  93. package/src/attr/types.ts +3 -3
  94. package/src/attr/values.ts +5 -1
  95. package/src/chains/localhost.ts +3 -0
  96. package/src/clients/createPublicClient.test.ts +1 -1
  97. package/src/clients/createPublicClient.ts +5 -5
  98. package/src/clients/createWalletClient.test.ts +2 -2
  99. package/src/clients/createWalletClient.ts +3 -5
  100. package/src/clients/decorators/arkivPublic.ts +13 -12
  101. package/src/clients/decorators/arkivWallet.ts +40 -32
  102. package/src/entity/create.test.ts +20 -1
  103. package/src/entity/errors.ts +4 -3
  104. package/src/entity/expiry.ts +1 -0
  105. package/src/entity/index.ts +2 -1
  106. package/src/entity/key.ts +23 -3
  107. package/src/entity/operations.ts +1 -0
  108. package/src/query/errors.ts +1 -1
  109. package/src/query/expression.ts +14 -7
  110. package/src/query/queryBuilder.ts +1 -1
  111. package/src/types/index.ts +4 -4
  112. package/src/types/rpcSchema.ts +1 -0
  113. package/src/types/txParams.ts +8 -0
  114. package/src/utils/arkivTransactions.test.ts +7 -1
  115. package/src/utils/arkivTransactions.ts +2 -2
  116. package/src/utils/expirationTime.ts +39 -0
  117. package/src/utils/payload.ts +25 -0
  118. package/dist/attr-BDZ-APg5.js.map +0 -1
  119. package/dist/chains-BJrZs6sG.js.map +0 -1
  120. package/dist/changeOwnership-B7bEgla4.d.cts.map +0 -1
  121. package/dist/changeOwnership-DwgtdSFc.d.ts.map +0 -1
  122. package/dist/entity-CFhbAv0R.js.map +0 -1
  123. package/dist/errors-DGB8AgT2.js.map +0 -1
  124. package/dist/expiry-DGRzrSan.js.map +0 -1
  125. package/dist/index-ClgIuxJ8.d.ts.map +0 -1
  126. package/dist/index-D0CmtiWT.d.cts.map +0 -1
  127. package/dist/index-D8LZt-3J.d.cts.map +0 -1
  128. package/dist/index-DVYFaXNV.d.ts.map +0 -1
  129. package/dist/payload-CIxSn_DW.js.map +0 -1
  130. package/dist/payload-Dgx3PQeK.d.ts.map +0 -1
  131. package/dist/payload-P0nWyjLg.d.cts.map +0 -1
  132. package/dist/queryBuilder-CbLL4pG5.js.map +0 -1
  133. package/dist/selection-BvK6yX0g.d.cts.map +0 -1
  134. package/dist/selection-fpmI3ADQ.d.ts.map +0 -1
@@ -1,5 +1,5 @@
1
- const require_attr = require('./attr-BvxHN99W.cjs');
2
- const require_flags = require('./flags-Ct8k0gpB.cjs');
1
+ const require_attr = require('./attr-BXTkpnoc.cjs');
2
+ const require_flags = require('./flags-DCD26uhe.cjs');
3
3
  const require_entity = require('./entity-B0t6sN7F.cjs');
4
4
  let viem = require("viem");
5
5
 
@@ -240,7 +240,7 @@ function toFlagsByte(value) {
240
240
  * | | `=` `!=` | `<` `<=` `>` `>=` | `STARTSWITH` |
241
241
  * | --- | --- | --- | --- |
242
242
  * | `bool` | yes | no | no |
243
- * | `i32` `u256` `dec` | yes | yes | no |
243
+ * | `i32` `u64` `u256` `dec` | yes | yes | no |
244
244
  * | `str` | yes | no | yes |
245
245
  * | `addr` `key` `bytes32` | yes | no | no |
246
246
  */
@@ -490,7 +490,7 @@ function ne(name, value) {
490
490
  return comparison(name, "!=", value);
491
491
  }
492
492
  /**
493
- * Attribute is greater than value. Ordered types only (`i32`, `u256`, `dec`).
493
+ * Attribute is greater than value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
494
494
  *
495
495
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
496
496
  *
@@ -502,7 +502,7 @@ function gt(name, value) {
502
502
  return comparison(name, ">", value);
503
503
  }
504
504
  /**
505
- * Attribute is greater than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
505
+ * Attribute is greater than or equal to value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
506
506
  *
507
507
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
508
508
  *
@@ -513,7 +513,7 @@ function gte(name, value) {
513
513
  return comparison(name, ">=", value);
514
514
  }
515
515
  /**
516
- * Attribute is less than value. Ordered types only (`i32`, `u256`, `dec`).
516
+ * Attribute is less than value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
517
517
  *
518
518
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
519
519
  *
@@ -524,7 +524,7 @@ function lt(name, value) {
524
524
  return comparison(name, "<", value);
525
525
  }
526
526
  /**
527
- * Attribute is less than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
527
+ * Attribute is less than or equal to value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
528
528
  *
529
529
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
530
530
  *
@@ -541,7 +541,9 @@ function lte(name, value) {
541
541
  * `startsWith("name", "é")` matches only the same byte sequence, not another normal form of it.
542
542
  *
543
543
  * @param prefix - The prefix, as a bare string or a `str` value.
544
- * @throws {UnsupportedOperatorError} If given a value that is not a `str`.
544
+ * @throws {InvalidPredicateError} If the name is not a queryable attribute.
545
+ * @throws {UnsupportedOperatorError} If given a value that is not a `str`, or a system attribute
546
+ * (none of which is a `str`).
545
547
  *
546
548
  * @example
547
549
  * startsWith("desc", "ab") // desc STARTSWITH str('ab')
@@ -580,7 +582,8 @@ function exists(name) {
580
582
  * Useful when the same name is written with different types across entities — a comparison already
581
583
  * asserts the type, so this is for asking about the type alone.
582
584
  *
583
- * @param tag - The type tag: `bool`, `i32`, `u256`, `dec`, `bytes32`, `str`, `addr` or `key`.
585
+ * @param tag - The type tag: `bool`, `i32`, `u64`, `u256`, `dec`, `bytes32`, `str`, `addr` or
586
+ * `key`.
584
587
  * @throws {InvalidPredicateError} If the tag is not a settable type, or the name is a system
585
588
  * attribute (whose type is fixed).
586
589
  *
@@ -590,7 +593,7 @@ function exists(name) {
590
593
  function hasType(name, tag) {
591
594
  const system = resolveReference(name);
592
595
  if (system !== void 0) throw new InvalidPredicateError(`"${name}" is always a ${system} — a system attribute has a fixed type, so TYPEOF(${name}) is a constant.`, name);
593
- if (!isUserTypeTag(tag)) throw new InvalidPredicateError(`"${tag}" is not a settable attribute type. Use one of bool, i32, u256, dec, bytes32, str, addr, key.`, name);
596
+ if (!isUserTypeTag(tag)) throw new InvalidPredicateError(`"${tag}" is not a settable attribute type. Use one of bool, i32, u64, u256, dec, bytes32, str, addr, key.`, name);
594
597
  return node({
595
598
  kind: "typeOf",
596
599
  name,
@@ -1,4 +1,4 @@
1
- import { C as ValueInput, G as StrValue, R as ArkivValue, Y as UserTypeTag, h as Attributes, m as AttributeSchema } from "./index-D8LZt-3J.cjs";
1
+ import { C as ValueInput, G as StrValue, R as ArkivValue, Y as UserTypeTag, h as Attributes, m as AttributeSchema } from "./index-CIcHPx2j.cjs";
2
2
  import { n as ResolvedCreationFlags } from "./flags-0Vl5rrHq.cjs";
3
3
  import { Account, Chain, Client, Hex, RpcSchema, Transport } from "viem";
4
4
 
@@ -68,6 +68,7 @@ type RpcSelect = {
68
68
  attributeSchema?: boolean;
69
69
  attributes?: boolean | Record<string, boolean>;
70
70
  };
71
+ /** The second parameter of `arkiv_query` — what to return, and where in the results to start. */
71
72
  type RpcQueryOptions = {
72
73
  /** Block height to read at, as a hex quantity. Defaults to the head, and must be within the node's retained range. */
73
74
  atBlock?: Hex;
@@ -163,6 +164,10 @@ declare class Entity implements EntityFields {
163
164
  }
164
165
  //#endregion
165
166
  //#region src/query/expression.d.ts
167
+ /**
168
+ * The comparison operators the query language defines. `<` `<=` `>` `>=` need an ordered type —
169
+ * `i32`, `u64`, `u256` or `dec`; every type accepts `=` and `!=`.
170
+ */
166
171
  type ComparisonOperator = "=" | "!=" | "<" | "<=" | ">" | ">=";
167
172
  /** A comparison between an attribute and a typed literal. */
168
173
  type ComparisonNode = {
@@ -239,7 +244,7 @@ declare function eq(name: string, value: ValueInput): ComparisonNode;
239
244
  */
240
245
  declare function ne(name: string, value: ValueInput): ComparisonNode;
241
246
  /**
242
- * Attribute is greater than value. Ordered types only (`i32`, `u256`, `dec`).
247
+ * Attribute is greater than value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
243
248
  *
244
249
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
245
250
  *
@@ -249,7 +254,7 @@ declare function ne(name: string, value: ValueInput): ComparisonNode;
249
254
  */
250
255
  declare function gt(name: string, value: ValueInput): ComparisonNode;
251
256
  /**
252
- * Attribute is greater than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
257
+ * Attribute is greater than or equal to value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
253
258
  *
254
259
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
255
260
  *
@@ -258,7 +263,7 @@ declare function gt(name: string, value: ValueInput): ComparisonNode;
258
263
  */
259
264
  declare function gte(name: string, value: ValueInput): ComparisonNode;
260
265
  /**
261
- * Attribute is less than value. Ordered types only (`i32`, `u256`, `dec`).
266
+ * Attribute is less than value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
262
267
  *
263
268
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
264
269
  *
@@ -267,7 +272,7 @@ declare function gte(name: string, value: ValueInput): ComparisonNode;
267
272
  */
268
273
  declare function lt(name: string, value: ValueInput): ComparisonNode;
269
274
  /**
270
- * Attribute is less than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
275
+ * Attribute is less than or equal to value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
271
276
  *
272
277
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
273
278
  *
@@ -282,7 +287,9 @@ declare function lte(name: string, value: ValueInput): ComparisonNode;
282
287
  * `startsWith("name", "é")` matches only the same byte sequence, not another normal form of it.
283
288
  *
284
289
  * @param prefix - The prefix, as a bare string or a `str` value.
285
- * @throws {UnsupportedOperatorError} If given a value that is not a `str`.
290
+ * @throws {InvalidPredicateError} If the name is not a queryable attribute.
291
+ * @throws {UnsupportedOperatorError} If given a value that is not a `str`, or a system attribute
292
+ * (none of which is a `str`).
286
293
  *
287
294
  * @example
288
295
  * startsWith("desc", "ab") // desc STARTSWITH str('ab')
@@ -305,7 +312,8 @@ declare function exists(name: string): ExistsNode;
305
312
  * Useful when the same name is written with different types across entities — a comparison already
306
313
  * asserts the type, so this is for asking about the type alone.
307
314
  *
308
- * @param tag - The type tag: `bool`, `i32`, `u256`, `dec`, `bytes32`, `str`, `addr` or `key`.
315
+ * @param tag - The type tag: `bool`, `i32`, `u64`, `u256`, `dec`, `bytes32`, `str`, `addr` or
316
+ * `key`.
309
317
  * @throws {InvalidPredicateError} If the tag is not a settable type, or the name is a system
310
318
  * attribute (whose type is fixed).
311
319
  *
@@ -430,4 +438,4 @@ type FullEntity = ProjectedEntity<AllSelected>;
430
438
  declare function toRpcSelect(selection?: SelectArg): RpcSelect;
431
439
  //#endregion
432
440
  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-BvK6yX0g.d.cts.map
441
+ //# sourceMappingURL=selection-Bv8_o-7i.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection-Bv8_o-7i.d.cts","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,GA2BA;EACQ,IAAA,EAAA,M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AA;;AACJ,KGkDJ,SAAA,GAAY,eHlDR,GAAA,GAAA;;KGqDX,QHpDsB,CAAA,CAAA,CAAA,GGoDR,CHpDQ,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;;;;;;;;;;;;;;ACjBY,iBC8EI,WAAA,CD9Ec,SAAA,CAAA,EC8EU,SD9EV,CAAA,EC8EsB,SD9EtB"}
@@ -1,4 +1,4 @@
1
- import { C as ValueInput, G as StrValue, R as ArkivValue, Y as UserTypeTag, h as Attributes, m as AttributeSchema } from "./index-DVYFaXNV.js";
1
+ import { C as ValueInput, G as StrValue, R as ArkivValue, Y as UserTypeTag, h as Attributes, m as AttributeSchema } from "./index-Cd2aaWme.js";
2
2
  import { n as ResolvedCreationFlags } from "./flags-wmcMoAnN.js";
3
3
  import { Account, Chain, Client, Hex, RpcSchema, Transport } from "viem";
4
4
 
@@ -68,6 +68,7 @@ type RpcSelect = {
68
68
  attributeSchema?: boolean;
69
69
  attributes?: boolean | Record<string, boolean>;
70
70
  };
71
+ /** The second parameter of `arkiv_query` — what to return, and where in the results to start. */
71
72
  type RpcQueryOptions = {
72
73
  /** Block height to read at, as a hex quantity. Defaults to the head, and must be within the node's retained range. */
73
74
  atBlock?: Hex;
@@ -163,6 +164,10 @@ declare class Entity implements EntityFields {
163
164
  }
164
165
  //#endregion
165
166
  //#region src/query/expression.d.ts
167
+ /**
168
+ * The comparison operators the query language defines. `<` `<=` `>` `>=` need an ordered type —
169
+ * `i32`, `u64`, `u256` or `dec`; every type accepts `=` and `!=`.
170
+ */
166
171
  type ComparisonOperator = "=" | "!=" | "<" | "<=" | ">" | ">=";
167
172
  /** A comparison between an attribute and a typed literal. */
168
173
  type ComparisonNode = {
@@ -239,7 +244,7 @@ declare function eq(name: string, value: ValueInput): ComparisonNode;
239
244
  */
240
245
  declare function ne(name: string, value: ValueInput): ComparisonNode;
241
246
  /**
242
- * Attribute is greater than value. Ordered types only (`i32`, `u256`, `dec`).
247
+ * Attribute is greater than value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
243
248
  *
244
249
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
245
250
  *
@@ -249,7 +254,7 @@ declare function ne(name: string, value: ValueInput): ComparisonNode;
249
254
  */
250
255
  declare function gt(name: string, value: ValueInput): ComparisonNode;
251
256
  /**
252
- * Attribute is greater than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
257
+ * Attribute is greater than or equal to value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
253
258
  *
254
259
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
255
260
  *
@@ -258,7 +263,7 @@ declare function gt(name: string, value: ValueInput): ComparisonNode;
258
263
  */
259
264
  declare function gte(name: string, value: ValueInput): ComparisonNode;
260
265
  /**
261
- * Attribute is less than value. Ordered types only (`i32`, `u256`, `dec`).
266
+ * Attribute is less than value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
262
267
  *
263
268
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
264
269
  *
@@ -267,7 +272,7 @@ declare function gte(name: string, value: ValueInput): ComparisonNode;
267
272
  */
268
273
  declare function lt(name: string, value: ValueInput): ComparisonNode;
269
274
  /**
270
- * Attribute is less than or equal to value. Ordered types only (`i32`, `u256`, `dec`).
275
+ * Attribute is less than or equal to value. Ordered types only (`i32`, `u64`, `u256`, `dec`).
271
276
  *
272
277
  * @throws {UnsupportedOperatorError} If the value's type carries no ordered index.
273
278
  *
@@ -282,7 +287,9 @@ declare function lte(name: string, value: ValueInput): ComparisonNode;
282
287
  * `startsWith("name", "é")` matches only the same byte sequence, not another normal form of it.
283
288
  *
284
289
  * @param prefix - The prefix, as a bare string or a `str` value.
285
- * @throws {UnsupportedOperatorError} If given a value that is not a `str`.
290
+ * @throws {InvalidPredicateError} If the name is not a queryable attribute.
291
+ * @throws {UnsupportedOperatorError} If given a value that is not a `str`, or a system attribute
292
+ * (none of which is a `str`).
286
293
  *
287
294
  * @example
288
295
  * startsWith("desc", "ab") // desc STARTSWITH str('ab')
@@ -305,7 +312,8 @@ declare function exists(name: string): ExistsNode;
305
312
  * Useful when the same name is written with different types across entities — a comparison already
306
313
  * asserts the type, so this is for asking about the type alone.
307
314
  *
308
- * @param tag - The type tag: `bool`, `i32`, `u256`, `dec`, `bytes32`, `str`, `addr` or `key`.
315
+ * @param tag - The type tag: `bool`, `i32`, `u64`, `u256`, `dec`, `bytes32`, `str`, `addr` or
316
+ * `key`.
309
317
  * @throws {InvalidPredicateError} If the tag is not a settable type, or the name is a system
310
318
  * attribute (whose type is fixed).
311
319
  *
@@ -430,4 +438,4 @@ type FullEntity = ProjectedEntity<AllSelected>;
430
438
  declare function toRpcSelect(selection?: SelectArg): RpcSelect;
431
439
  //#endregion
432
440
  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
441
+ //# sourceMappingURL=selection-ox7zdtVm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection-ox7zdtVm.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,GA2BA;EACQ,IAAA,EAAA,MAAA;EACL,IAAA,EAAA,MAAA;CAAY;AAU3B;AAeA;;AAIW,KAlDC,gBAAA,GAkDD;EAED,QAAA,CAAA,EAAA,OAAA;EAAG,uBAAA,CAAA,EAAA,OAAA;EAKD,GAAA,EAAA,MAAA;CAGoC;;;;;KAlDpC,SAAA;QACJ;EClCI,KAAA,CAAA,EDmCF,GCnCE;EACQ,OAAA,CAAA,EDmCR,GCnCQ;EAAY,SAAA,CAAA,EDoClB,GCpCkB;EAChB,SAAA,CAAA,EDoCF,GCpCE;EAAoB,SAAA,CAAA,EDqCtB,GCrCsB;EACT,aAAA,CAAA,EDqCT,gBCrCS,GAAA,MAAA;EAAsB,WAAA,CAAA,EAAA,MAAA;EAC7B,OAAA,CAAA,EDsCR,GCtCQ;EAAwB,eAAA,CAAA,EDuCxB,uBCvCwB,EAAA;EACjC,UAAA,CAAA,EDuCI,YCvCJ,EAAA;CAAW;;;;;;;;ACAV,KFiDA,SAAA,GEjDY;EAChB,GAAA,CAAA,EAAA,OAAA;EACE,KAAA,CAAA,EAAA,OAAA;EACE,OAAA,CAAA,EAAA,OAAA;EAQM,SAAA,CAAA,EAAA,OAAA;EAEN,SAAA,CAAA,EAAA,OAAA;EAEQ,SAAA,CAAA,EAAA,OAAA;EAEL,aAAA,CAAA,EAAA,OAAA;EAAU,WAAA,C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";
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 };
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-Bv8_o-7i.cjs";
6
+ import { C as QueryOptions, D as PredictedEntityKey, E as PredictEntityKeysReturnType, O as GetBlockTimingReturnType, S as OwnershipTransferredEvent, T as PredictEntityKeysParameters, _ as EntityDeletedEvent, a as ExecuteBatchParameters, b as EntityPatchedEvent, c as PatchEntityReturnType, d as DeleteEntityParameters, f as DeleteEntityReturnType, g as EntityCreatedEvent, h as WatchEntityEventsParameters, i as MimeType, l as ExtendEntityParameters, m as CreateEntityReturnType, n as ChangeOwnershipReturnType, o as ExecuteBatchReturnType, p as CreateEntityParameters, r as TxParams, s as PatchEntityParameters, t as ChangeOwnershipParameters, u as ExtendEntityReturnType, v as EntityEvent, w as QueryReturnType, x as ExpiryExtendedEvent, y as EntityEventContext } from "../changeOwnership-BofkLnXJ.cjs";
7
+ export { ArkivRpcSchema, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, EntityCreatedEvent, EntityDeletedEvent, EntityEvent, EntityEventContext, EntityFields, EntityPatchedEvent, ExecuteBatchParameters, ExecuteBatchReturnType, ExpiryExtendedEvent, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, OwnershipTransferredEvent, PatchEntityParameters, PatchEntityReturnType, PredictEntityKeysParameters, PredictEntityKeysReturnType, PredictedEntityKey, QueryOptions, QueryReturnType, RpcAttribute, RpcAttributeSchemaEntry, RpcCreationFlags, RpcEntity, RpcQueryOptions, RpcSelect, TxParams, WatchEntityEventsParameters };
@@ -1,7 +1,7 @@
1
- import "../index-DVYFaXNV.js";
2
- import "../index-ClgIuxJ8.js";
1
+ import "../index-Cd2aaWme.js";
2
+ import "../index-ezMZ2-JH.js";
3
3
  import "../expiry-BxOlvVWC.js";
4
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 };
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-ox7zdtVm.js";
6
+ import { C as QueryOptions, D as PredictedEntityKey, E as PredictEntityKeysReturnType, O as GetBlockTimingReturnType, S as OwnershipTransferredEvent, T as PredictEntityKeysParameters, _ as EntityDeletedEvent, a as ExecuteBatchParameters, b as EntityPatchedEvent, c as PatchEntityReturnType, d as DeleteEntityParameters, f as DeleteEntityReturnType, g as EntityCreatedEvent, h as WatchEntityEventsParameters, i as MimeType, l as ExtendEntityParameters, m as CreateEntityReturnType, n as ChangeOwnershipReturnType, o as ExecuteBatchReturnType, p as CreateEntityParameters, r as TxParams, s as PatchEntityParameters, t as ChangeOwnershipParameters, u as ExtendEntityReturnType, v as EntityEvent, w as QueryReturnType, x as ExpiryExtendedEvent, y as EntityEventContext } from "../changeOwnership-B0ar96ub.js";
7
+ export { ArkivRpcSchema, ChangeOwnershipParameters, ChangeOwnershipReturnType, CreateEntityParameters, CreateEntityReturnType, DeleteEntityParameters, DeleteEntityReturnType, Entity, EntityCreatedEvent, EntityDeletedEvent, EntityEvent, EntityEventContext, EntityFields, EntityPatchedEvent, ExecuteBatchParameters, ExecuteBatchReturnType, ExpiryExtendedEvent, ExtendEntityParameters, ExtendEntityReturnType, GetBlockTimingReturnType, MimeType, OwnershipTransferredEvent, PatchEntityParameters, PatchEntityReturnType, PredictEntityKeysParameters, PredictEntityKeysReturnType, PredictedEntityKey, QueryOptions, QueryReturnType, RpcAttribute, RpcAttributeSchemaEntry, RpcCreationFlags, RpcEntity, RpcQueryOptions, RpcSelect, TxParams, WatchEntityEventsParameters };
@@ -1,6 +1,6 @@
1
- require('../errors-D-eJkGVc.cjs');
2
- require('../expiry-BUYIXTGb.cjs');
3
- const require_payload = require('../payload-Bnw1hrvb.cjs');
1
+ require('../errors-DhV00966.cjs');
2
+ require('../expiry-CG9GhVXv.cjs');
3
+ const require_payload = require('../payload-DqFweqiO.cjs');
4
4
 
5
5
  exports.ExpirationTime = require_payload.ExpirationTime;
6
6
  exports.jsonToPayload = require_payload.jsonToPayload;
@@ -1,3 +1,3 @@
1
1
  import "../expiry-DRV29F1r.cjs";
2
- import { i as ExpirationTime, n as stringToPayload, r as DeadlineOptions, t as jsonToPayload } from "../payload-P0nWyjLg.cjs";
2
+ import { i as ExpirationTime, n as stringToPayload, r as DeadlineOptions, t as jsonToPayload } from "../payload-Dfu30njp.cjs";
3
3
  export { DeadlineOptions, ExpirationTime, jsonToPayload, stringToPayload };
@@ -1,3 +1,3 @@
1
1
  import "../expiry-BxOlvVWC.js";
2
- import { i as ExpirationTime, n as stringToPayload, r as DeadlineOptions, t as jsonToPayload } from "../payload-Dgx3PQeK.js";
2
+ import { i as ExpirationTime, n as stringToPayload, r as DeadlineOptions, t as jsonToPayload } from "../payload-CGvVPZQX.js";
3
3
  export { DeadlineOptions, ExpirationTime, jsonToPayload, stringToPayload };
@@ -1,5 +1,5 @@
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";
1
+ import "../errors-D2E1GRjw.js";
2
+ import "../expiry-Cgdb_dbq.js";
3
+ import { n as stringToPayload, r as ExpirationTime, t as jsonToPayload } from "../payload-DE7wMztL.js";
4
4
 
5
5
  export { ExpirationTime, jsonToPayload, stringToPayload };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkiv-network/sdk",
3
- "version": "0.8.0-dev.1",
3
+ "version": "0.8.0-dev.2",
4
4
  "description": "TypeScript client library for Arkiv's blockchains interactions",
5
5
  "type": "module",
6
6
  "target": "esnext",
@@ -85,8 +85,6 @@
85
85
  "lint": "biome check src/",
86
86
  "lint:fix": "biome check --write src/",
87
87
  "test:unit": "bun test src/**/*",
88
- "docs": "bunx typedoc --plugin typedoc-plugin-markdown",
89
- "docs:verify": "bunx typedoc --emit none --plugin typedoc-plugin-markdown",
90
88
  "package": "rimraf arkiv-network-sdk-*.tgz && bun run build && bun pm pack --no-cache",
91
89
  "package:test": "bun run package && mv arkiv-network-sdk-*.tgz arkiv-network-sdk-latest.tgz",
92
90
  "prepublishOnly": "bun run build && bun run package && mv arkiv-network-sdk-*.tgz arkiv-network-sdk-latest.tgz",
@@ -102,8 +100,6 @@
102
100
  "@types/bun": "latest",
103
101
  "rimraf": "^6.0.1",
104
102
  "tsdown": "^0.16.0",
105
- "typedoc": "^0.28.14",
106
- "typedoc-plugin-markdown": "^4.9.0",
107
103
  "typescript": "^5.9.2",
108
104
  "viem": "^2.38.2"
109
105
  },
@@ -5,6 +5,7 @@ import { NoEntityFoundError } from "../../errors"
5
5
  import { runQuery } from "../../query/engine"
6
6
  import { eq } from "../../query/expression"
7
7
  import { type FullEntity, toRpcSelect } from "../../query/selection"
8
+ import type { Entity } from "../../types/entity"
8
9
 
9
10
  /**
10
11
  * Reads one entity by key, with every field selected.
@@ -2,7 +2,7 @@ import { describe, expect, it, vi } from "bun:test"
2
2
  import { encodeFunctionResult, type Hex } from "viem"
3
3
  import type { ArkivClient } from "../../clients/baseClient"
4
4
  import { ARKIV_ADDRESS } from "../../consts"
5
- import { predictEntityKey } from "../../entity/key"
5
+ import { NO_SALT, predictEntityKey } from "../../entity/key"
6
6
  import { ENTITY_NONCE_ABI } from "../../entity/operations"
7
7
  import { getEntityNonce } from "./getEntityNonce"
8
8
  import { predictEntityKeys } from "./predictEntityKeys"
@@ -105,6 +105,22 @@ describe("predictEntityKeys", () => {
105
105
  )
106
106
  })
107
107
 
108
+ it("takes NO_SALT in a slot, and pairs the key with the zero it resolves to", async () => {
109
+ const { client } = makeClient(4n)
110
+ const [first, second] = await predictEntityKeys(client, {
111
+ owner: OWNER,
112
+ salts: [NO_SALT, 5n],
113
+ })
114
+ expect(first).toEqual({
115
+ salt: 0n,
116
+ key: predictEntityKey({ owner: OWNER, nonce: 4n, salt: 0n, chainId: CHAIN_ID }),
117
+ })
118
+ expect(second).toEqual({
119
+ salt: 5n,
120
+ key: predictEntityKey({ owner: OWNER, nonce: 5n, salt: 5n, chainId: CHAIN_ID }),
121
+ })
122
+ })
123
+
108
124
  it("prefers the salts it was given over the count", async () => {
109
125
  const { client } = makeClient(0n)
110
126
  const pairs = await predictEntityKeys(client, { owner: OWNER, count: 5, salts: [9n] })
@@ -1,7 +1,13 @@
1
1
  import type { Address, Hex } from "viem"
2
2
  import { getChainId } from "viem/actions"
3
3
  import type { ArkivClient } from "../../clients/baseClient"
4
- import { predictEntityKey, randomSalt, validateSalt } from "../../entity/key"
4
+ import {
5
+ NO_SALT,
6
+ predictEntityKey,
7
+ randomSalt,
8
+ resolveSalt,
9
+ type SaltInput,
10
+ } from "../../entity/key"
5
11
  import { getEntityNonce } from "./getEntityNonce"
6
12
 
7
13
  /**
@@ -13,14 +19,18 @@ import { getEntityNonce } from "./getEntityNonce"
13
19
  export type PredictedEntityKey = {
14
20
  /** The key the create will be given. */
15
21
  key: Hex
16
- /** The salt the create must carry for its key to come out as {@link PredictedEntityKey.key}. */
22
+ /**
23
+ * The salt the create must carry for its key to come out as {@link PredictedEntityKey.key}.
24
+ * Always a plain `uint128` — a requested {@link NO_SALT} comes back as the `0n` it resolves to,
25
+ * which a create accepts just the same.
26
+ */
17
27
  salt: bigint
18
28
  }
19
29
 
20
- /** Parameters for {@link predictEntityKeys}. */
30
+ /** Parameters for `client.predictEntityKeys`. */
21
31
  export type PredictEntityKeysParameters<
22
32
  TCount extends number = number,
23
- TSalts extends readonly bigint[] | undefined = readonly bigint[] | undefined,
33
+ TSalts extends readonly SaltInput[] | undefined = readonly SaltInput[] | undefined,
24
34
  > = {
25
35
  /** The account that will sign the creates. Its nonce is what the keys are derived from. */
26
36
  owner: Address
@@ -34,7 +44,8 @@ export type PredictEntityKeysParameters<
34
44
  count?: TCount | undefined
35
45
  /**
36
46
  * The salt each create will carry, in batch order. Defaults to `count` fresh random salts —
37
- * either way each key comes back paired with the salt that mints it.
47
+ * either way each key comes back paired with the salt that mints it. Pass {@link NO_SALT} in a
48
+ * slot whose create opts out of salting.
38
49
  */
39
50
  salts?: TSalts
40
51
  }
@@ -46,13 +57,13 @@ export type PredictEntityKeysParameters<
46
57
  * tuple, gives a fixed-length tuple; a count computed at runtime gives a plain array.
47
58
  *
48
59
  * `TSalts` is wrapped in a tuple to stop the conditional distributing over it. Left naked, the
49
- * `readonly bigint[] | undefined` default would take both branches and union a tuple with an array,
50
- * which widens the length straight back to `number`.
60
+ * `readonly SaltInput[] | undefined` default would take both branches and union a tuple with an
61
+ * array, which widens the length straight back to `number`.
51
62
  */
52
63
  export type PredictEntityKeysReturnType<
53
64
  TCount extends number = number,
54
- TSalts extends readonly bigint[] | undefined = readonly bigint[] | undefined,
55
- > = [TSalts] extends [readonly bigint[]]
65
+ TSalts extends readonly SaltInput[] | undefined = readonly SaltInput[] | undefined,
66
+ > = [TSalts] extends [readonly SaltInput[]]
56
67
  ? { -readonly [Index in keyof TSalts]: PredictedEntityKey }
57
68
  : Repeat<PredictedEntityKey, TCount>
58
69
 
@@ -79,7 +90,7 @@ type Repeat<T, TLength extends number, TAcc extends T[] = []> = number extends T
79
90
  *
80
91
  * The prediction is valid only while nothing else from this owner is in flight. Every create that
81
92
  * lands first takes the nonce with it and moves these keys. For a key you can rely on
82
- * unconditionally, read it back from the create instead — `createEntity` and `mutateEntities`
93
+ * unconditionally, read it back from the create instead — `createEntity` and `executeBatch`
83
94
  * report the keys the engine actually minted.
84
95
  *
85
96
  * @param parameters - Owner, and either a count or the salts. {@link PredictEntityKeysParameters}
@@ -89,7 +100,7 @@ type Repeat<T, TLength extends number, TAcc extends T[] = []> = number extends T
89
100
  * import { key } from "@arkiv-network/sdk/attr"
90
101
  *
91
102
  * const [parent, child] = await client.predictEntityKeys({ owner: account.address, count: 2 })
92
- * await wallet.mutateEntities({
103
+ * await client.executeBatch({
93
104
  * creates: [
94
105
  * { payload, contentType, expires, salt: parent.salt },
95
106
  * {
@@ -104,7 +115,7 @@ type Repeat<T, TLength extends number, TAcc extends T[] = []> = number extends T
104
115
  */
105
116
  export async function predictEntityKeys<
106
117
  const TCount extends number = number,
107
- const TSalts extends readonly bigint[] | undefined = undefined,
118
+ const TSalts extends readonly SaltInput[] | undefined = undefined,
108
119
  >(
109
120
  client: ArkivClient,
110
121
  { owner, count, salts }: PredictEntityKeysParameters<TCount, TSalts>,
@@ -121,12 +132,15 @@ export async function predictEntityKeys<
121
132
  }
122
133
 
123
134
  /** The salts to derive from: the ones given, or `count` fresh random ones. */
124
- function resolveSalts(count: number | undefined, salts: readonly bigint[] | undefined): bigint[] {
135
+ function resolveSalts(
136
+ count: number | undefined,
137
+ salts: readonly SaltInput[] | undefined,
138
+ ): bigint[] {
125
139
  if (salts !== undefined) {
126
140
  if (salts.length === 0) {
127
141
  throw new Error("predictEntityKeys: `salts` is empty — there is nothing to predict")
128
142
  }
129
- return salts.map(validateSalt)
143
+ return salts.map(resolveSalt)
130
144
  }
131
145
  if (count === undefined) {
132
146
  throw new Error("predictEntityKeys: pass either `count` or `salts`")
@@ -1,10 +1,11 @@
1
1
  import type { Hash, Hex } from "viem"
2
2
  import type { AttributeInputs } from "../../attr"
3
3
  import type { ArkivClient } from "../../clients/baseClient"
4
- import type { CreationFlags, Expiry } from "../../entity"
4
+ import type { CreationFlags, Expiry, NO_SALT, SaltInput } from "../../entity"
5
5
  import { EntityMutationError } from "../../errors"
6
6
  import type { MimeType, TxParams } from "../../types"
7
7
  import { sendArkivTransaction } from "../../utils/arkivTransactions"
8
+ import type { ExpirationTime } from "../../utils/expirationTime"
8
9
  import { getLogger } from "../../utils/logger"
9
10
 
10
11
  const logger = getLogger("actions:wallet:create-entity")
@@ -66,8 +67,8 @@ export type CreateEntityParameters = {
66
67
  contentType: MimeType | (string & {})
67
68
  /**
68
69
  * The entity's queryable attributes, keyed by name. Values are the tagged constructors from
69
- * `@arkiv-network/sdk/attr` — `i32`, `u256`, `dec`, `str`, `addr`, `key`, `bytes32`, `bool` — or
70
- * a bare `boolean`, `number`, `bigint` or `string` where the type is unambiguous.
70
+ * `@arkiv-network/sdk/attr` — `i32`, `u64`, `u256`, `dec`, `str`, `addr`, `key`, `bytes32`,
71
+ * `bool` — or a bare `boolean`, `number`, `bigint` or `string` where the type is unambiguous.
71
72
  *
72
73
  * @throws {InvalidAttributeNameError} If a name violates the attribute-name grammar.
73
74
  * @throws {InvalidValueError} If a value does not fit the type it names or defaults to.
@@ -82,10 +83,10 @@ export type CreateEntityParameters = {
82
83
  * The salt mixed into the entity key. Defaults to 128 random bits, which makes the key
83
84
  * unpredictable to everyone but the creator.
84
85
  *
85
- * Pass `0n` for a key derived from the owner and nonce alone — predictable by anyone, which is
86
- * what you want only when a third party must be able to compute the key in advance.
86
+ * Pass {@link NO_SALT} for a key derived from the owner and nonce alone — predictable by anyone,
87
+ * which is what you want only when a third party must be able to compute the key in advance.
87
88
  */
88
- salt?: bigint | undefined
89
+ salt?: SaltInput | undefined
89
90
  }
90
91
 
91
92
  /**
@@ -1,6 +1,6 @@
1
1
  import { describe, expect, it, vi } from "bun:test"
2
2
  import type { ArkivClient } from "../../clients/baseClient"
3
- import { mutateEntities } from "./mutateEntities"
3
+ import { executeBatch } from "./executeBatch"
4
4
 
5
5
  const ENTITY_KEY = `0x${"ab".repeat(32)}` as const
6
6
  const NEW_OWNER = "0x2222222222222222222222222222222222222222"
@@ -29,7 +29,7 @@ describe("the empty-batch guard", () => {
29
29
  // An ownership-only batch is a batch: it used to be rejected because the guard listed
30
30
  // creates/updates/deletes/extensions and forgot ownershipChanges.
31
31
  const { client, writeContract } = makeClient()
32
- const result = await mutateEntities(client, {
32
+ const result = await executeBatch(client, {
33
33
  ownershipChanges: [{ entityKey: ENTITY_KEY, newOwner: NEW_OWNER }],
34
34
  })
35
35
  expect(writeContract).toHaveBeenCalledTimes(1)
@@ -38,9 +38,9 @@ describe("the empty-batch guard", () => {
38
38
 
39
39
  it("rejects a batch with nothing in it", async () => {
40
40
  const { client, writeContract } = makeClient()
41
- await expect(mutateEntities(client, {})).rejects.toThrow(/No operations/)
41
+ await expect(executeBatch(client, {})).rejects.toThrow(/No operations/)
42
42
  // Present but empty is just as empty — the engine would revert with EmptyBatch().
43
- await expect(mutateEntities(client, { deletes: [], ownershipChanges: [] })).rejects.toThrow(
43
+ await expect(executeBatch(client, { deletes: [], ownershipChanges: [] })).rejects.toThrow(
44
44
  /No operations/,
45
45
  )
46
46
  expect(writeContract).not.toHaveBeenCalled()
@@ -52,10 +52,10 @@ describe("the empty-batch guard", () => {
52
52
  // keys would score this batch as non-empty and then drop it on the way to the wire, sending
53
53
  // execute([]) — so the guard counts the five kinds that actually reach the transaction.
54
54
  const stale = { updates: [{ entityKey: ENTITY_KEY, set: { level: 1 } }] } as never
55
- await expect(mutateEntities(client, stale)).rejects.toThrow(/No operations/)
55
+ await expect(executeBatch(client, stale)).rejects.toThrow(/No operations/)
56
56
  // A typo is the same mistake with a different name.
57
57
  await expect(
58
- mutateEntities(client, { delete: [{ entityKey: ENTITY_KEY }] } as never),
58
+ executeBatch(client, { delete: [{ entityKey: ENTITY_KEY }] } as never),
59
59
  ).rejects.toThrow(/No operations/)
60
60
  expect(writeContract).not.toHaveBeenCalled()
61
61
  })
@@ -65,7 +65,7 @@ describe("the empty-batch guard", () => {
65
65
  // The dangerous shape: the creates apply and the transaction succeeds, so nothing surfaces the
66
66
  // fact that the `updates` never happened. The guard cannot catch this one — only the caller's
67
67
  // types can — but the result must at least not claim they did.
68
- const result = await mutateEntities(client, {
68
+ const result = await executeBatch(client, {
69
69
  deletes: [{ entityKey: ENTITY_KEY }],
70
70
  updates: [{ entityKey: ENTITY_KEY, set: { level: 1 } }],
71
71
  } as never)