@arkiv-network/sdk 0.8.0-dev.1 → 0.8.0-dev.3

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 (135) 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 +59 -50
  52. package/dist/index.d.cts +58 -50
  53. package/dist/index.d.cts.map +1 -1
  54. package/dist/index.d.ts +58 -50
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +59 -51
  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-COWt6aIF.js} +17 -12
  70. package/dist/queryBuilder-COWt6aIF.js.map +1 -0
  71. package/dist/{queryBuilder-BXDvX1K_.cjs → queryBuilder-DaLxNgeI.cjs} +16 -11
  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 +8 -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 +2 -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/errors.ts +7 -2
  109. package/src/query/errors.ts +1 -1
  110. package/src/query/expression.ts +14 -7
  111. package/src/query/queryBuilder.ts +1 -1
  112. package/src/types/index.ts +4 -4
  113. package/src/types/rpcSchema.ts +1 -0
  114. package/src/types/txParams.ts +8 -0
  115. package/src/utils/arkivTransactions.test.ts +7 -1
  116. package/src/utils/arkivTransactions.ts +10 -5
  117. package/src/utils/expirationTime.ts +39 -0
  118. package/src/utils/payload.ts +25 -0
  119. package/dist/attr-BDZ-APg5.js.map +0 -1
  120. package/dist/chains-BJrZs6sG.js.map +0 -1
  121. package/dist/changeOwnership-B7bEgla4.d.cts.map +0 -1
  122. package/dist/changeOwnership-DwgtdSFc.d.ts.map +0 -1
  123. package/dist/entity-CFhbAv0R.js.map +0 -1
  124. package/dist/errors-DGB8AgT2.js.map +0 -1
  125. package/dist/expiry-DGRzrSan.js.map +0 -1
  126. package/dist/index-ClgIuxJ8.d.ts.map +0 -1
  127. package/dist/index-D0CmtiWT.d.cts.map +0 -1
  128. package/dist/index-D8LZt-3J.d.cts.map +0 -1
  129. package/dist/index-DVYFaXNV.d.ts.map +0 -1
  130. package/dist/payload-CIxSn_DW.js.map +0 -1
  131. package/dist/payload-Dgx3PQeK.d.ts.map +0 -1
  132. package/dist/payload-P0nWyjLg.d.cts.map +0 -1
  133. package/dist/queryBuilder-CbLL4pG5.js.map +0 -1
  134. package/dist/selection-BvK6yX0g.d.cts.map +0 -1
  135. package/dist/selection-fpmI3ADQ.d.ts.map +0 -1
@@ -1,11 +1,18 @@
1
- import { p as AttributeInputs } from "./index-D8LZt-3J.cjs";
1
+ import { p as AttributeInputs } from "./index-CIcHPx2j.cjs";
2
+ import { a as SaltInput } from "./index-BGp2plHs.cjs";
2
3
  import { n as Expiry } from "./expiry-DRV29F1r.cjs";
3
4
  import { n as ResolvedCreationFlags, t as CreationFlags } from "./flags-0Vl5rrHq.cjs";
4
- import { i as SelectArg, k as Entity } from "./selection-BvK6yX0g.cjs";
5
+ import { i as SelectArg, k as Entity } from "./selection-Bv8_o-7i.cjs";
5
6
  import { Address, Hash, Hex } from "viem";
6
7
 
8
+ //#region src/actions/public/getBlockTiming.d.ts
9
+ type GetBlockTimingReturnType = {
10
+ currentBlock: bigint;
11
+ currentBlockTime: number;
12
+ blockDuration: number;
13
+ };
14
+ //#endregion
7
15
  //#region src/actions/public/predictEntityKeys.d.ts
8
-
9
16
  /**
10
17
  * A key a create will be given, together with the salt that mints it.
11
18
  *
@@ -15,11 +22,15 @@ import { Address, Hash, Hex } from "viem";
15
22
  type PredictedEntityKey = {
16
23
  /** The key the create will be given. */
17
24
  key: Hex;
18
- /** The salt the create must carry for its key to come out as {@link PredictedEntityKey.key}. */
25
+ /**
26
+ * The salt the create must carry for its key to come out as {@link PredictedEntityKey.key}.
27
+ * Always a plain `uint128` — a requested {@link NO_SALT} comes back as the `0n` it resolves to,
28
+ * which a create accepts just the same.
29
+ */
19
30
  salt: bigint;
20
31
  };
21
- /** Parameters for {@link predictEntityKeys}. */
22
- type PredictEntityKeysParameters<TCount extends number = number, TSalts extends readonly bigint[] | undefined = readonly bigint[] | undefined> = {
32
+ /** Parameters for `client.predictEntityKeys`. */
33
+ type PredictEntityKeysParameters<TCount extends number = number, TSalts extends readonly SaltInput[] | undefined = readonly SaltInput[] | undefined> = {
23
34
  /** The account that will sign the creates. Its nonce is what the keys are derived from. */
24
35
  owner: Address;
25
36
  /**
@@ -32,7 +43,8 @@ type PredictEntityKeysParameters<TCount extends number = number, TSalts extends
32
43
  count?: TCount | undefined;
33
44
  /**
34
45
  * The salt each create will carry, in batch order. Defaults to `count` fresh random salts —
35
- * either way each key comes back paired with the salt that mints it.
46
+ * either way each key comes back paired with the salt that mints it. Pass {@link NO_SALT} in a
47
+ * slot whose create opts out of salting.
36
48
  */
37
49
  salts?: TSalts;
38
50
  };
@@ -43,10 +55,10 @@ type PredictEntityKeysParameters<TCount extends number = number, TSalts extends
43
55
  * tuple, gives a fixed-length tuple; a count computed at runtime gives a plain array.
44
56
  *
45
57
  * `TSalts` is wrapped in a tuple to stop the conditional distributing over it. Left naked, the
46
- * `readonly bigint[] | undefined` default would take both branches and union a tuple with an array,
47
- * which widens the length straight back to `number`.
58
+ * `readonly SaltInput[] | undefined` default would take both branches and union a tuple with an
59
+ * array, which widens the length straight back to `number`.
48
60
  */
49
- type PredictEntityKeysReturnType<TCount extends number = number, TSalts extends readonly bigint[] | undefined = readonly bigint[] | undefined> = [TSalts] extends [readonly bigint[]] ? { -readonly [Index in keyof TSalts]: PredictedEntityKey } : Repeat<PredictedEntityKey, TCount>;
61
+ type PredictEntityKeysReturnType<TCount extends number = number, TSalts extends readonly SaltInput[] | undefined = readonly SaltInput[] | undefined> = [TSalts] extends [readonly SaltInput[]] ? { -readonly [Index in keyof TSalts]: PredictedEntityKey } : Repeat<PredictedEntityKey, TCount>;
50
62
  /**
51
63
  * A tuple of `TLength` × `T`, or a plain array when the length is only known at runtime.
52
64
  *
@@ -65,7 +77,7 @@ type Repeat<T, TLength extends number, TAcc extends T[] = []> = number extends T
65
77
  *
66
78
  * The prediction is valid only while nothing else from this owner is in flight. Every create that
67
79
  * lands first takes the nonce with it and moves these keys. For a key you can rely on
68
- * unconditionally, read it back from the create instead — `createEntity` and `mutateEntities`
80
+ * unconditionally, read it back from the create instead — `createEntity` and `executeBatch`
69
81
  * report the keys the engine actually minted.
70
82
  *
71
83
  * @param parameters - Owner, and either a count or the salts. {@link PredictEntityKeysParameters}
@@ -75,7 +87,7 @@ type Repeat<T, TLength extends number, TAcc extends T[] = []> = number extends T
75
87
  * import { key } from "@arkiv-network/sdk/attr"
76
88
  *
77
89
  * const [parent, child] = await client.predictEntityKeys({ owner: account.address, count: 2 })
78
- * await wallet.mutateEntities({
90
+ * await client.executeBatch({
79
91
  * creates: [
80
92
  * { payload, contentType, expires, salt: parent.salt },
81
93
  * {
@@ -209,13 +221,6 @@ type WatchEntityEventsParameters = {
209
221
  pollingInterval?: number | undefined;
210
222
  };
211
223
  //#endregion
212
- //#region src/actions/public/getBlockTiming.d.ts
213
- type GetBlockTimingReturnType = {
214
- currentBlock: bigint;
215
- currentBlockTime: number;
216
- blockDuration: number;
217
- };
218
- //#endregion
219
224
  //#region src/actions/wallet/createEntity.d.ts
220
225
  /**
221
226
  * Parameters for creating an entity.
@@ -274,8 +279,8 @@ type CreateEntityParameters = {
274
279
  contentType: MimeType | (string & {});
275
280
  /**
276
281
  * The entity's queryable attributes, keyed by name. Values are the tagged constructors from
277
- * `@arkiv-network/sdk/attr` — `i32`, `u256`, `dec`, `str`, `addr`, `key`, `bytes32`, `bool` — or
278
- * a bare `boolean`, `number`, `bigint` or `string` where the type is unambiguous.
282
+ * `@arkiv-network/sdk/attr` — `i32`, `u64`, `u256`, `dec`, `str`, `addr`, `key`, `bytes32`,
283
+ * `bool` — or a bare `boolean`, `number`, `bigint` or `string` where the type is unambiguous.
279
284
  *
280
285
  * @throws {InvalidAttributeNameError} If a name violates the attribute-name grammar.
281
286
  * @throws {InvalidValueError} If a value does not fit the type it names or defaults to.
@@ -290,10 +295,10 @@ type CreateEntityParameters = {
290
295
  * The salt mixed into the entity key. Defaults to 128 random bits, which makes the key
291
296
  * unpredictable to everyone but the creator.
292
297
  *
293
- * Pass `0n` for a key derived from the owner and nonce alone — predictable by anyone, which is
294
- * what you want only when a third party must be able to compute the key in advance.
298
+ * Pass {@link NO_SALT} for a key derived from the owner and nonce alone — predictable by anyone,
299
+ * which is what you want only when a third party must be able to compute the key in advance.
295
300
  */
296
- salt?: bigint | undefined;
301
+ salt?: SaltInput | undefined;
297
302
  };
298
303
  /**
299
304
  * The result of creating an entity.
@@ -398,9 +403,9 @@ type PatchEntityParameters = {
398
403
  * Attributes to write, keyed by name. An existing attribute is overwritten — including with a
399
404
  * different type — and a name the entity does not carry yet is added.
400
405
  *
401
- * Values are the tagged constructors from `@arkiv-network/sdk/attr` — `i32`, `u256`, `dec`, `str`,
402
- * `addr`, `key`, `bytes32`, `bool` — or a bare `boolean`, `number`, `bigint` or `string` where the
403
- * type is unambiguous.
406
+ * Values are the tagged constructors from `@arkiv-network/sdk/attr` — `i32`, `u64`, `u256`,
407
+ * `dec`, `str`, `addr`, `key`, `bytes32`, `bool` — or a bare `boolean`, `number`, `bigint` or
408
+ * `string` where the type is unambiguous.
404
409
  *
405
410
  * @throws {InvalidAttributeNameError} If a name violates the attribute-name grammar.
406
411
  * @throws {InvalidValueError} If a value does not fit the type it names or defaults to.
@@ -432,14 +437,14 @@ type PatchEntityReturnType = {
432
437
  txHash: Hash;
433
438
  };
434
439
  //#endregion
435
- //#region src/actions/wallet/mutateEntities.d.ts
440
+ //#region src/actions/wallet/executeBatch.d.ts
436
441
  /**
437
- * Parameters for the mutateEntities function.
442
+ * Parameters for the executeBatch function.
438
443
  *
439
444
  * At least one operation is required; a batch with nothing in it throws rather than spending gas on
440
445
  * an empty transaction.
441
446
  */
442
- type MutateEntitiesParameters = {
447
+ type ExecuteBatchParameters = {
443
448
  /** The entities to create. */
444
449
  creates?: CreateEntityParameters[];
445
450
  /** The patches to apply. */
@@ -451,8 +456,8 @@ type MutateEntitiesParameters = {
451
456
  /** The ownership transfers to perform. */
452
457
  ownershipChanges?: ChangeOwnershipParameters[];
453
458
  };
454
- /** Return type for the mutateEntities function. */
455
- type MutateEntitiesReturnType = {
459
+ /** Return type for the executeBatch function. */
460
+ type ExecuteBatchReturnType = {
456
461
  /** The transaction hash. */
457
462
  txHash: Hash;
458
463
  /** The keys of the created entities, in batch order. */
@@ -471,6 +476,14 @@ type MutateEntitiesReturnType = {
471
476
  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";
472
477
  //#endregion
473
478
  //#region src/types/txParams.d.ts
479
+ /**
480
+ * Transaction fields a write action passes through to the wallet, for the cases where the defaults
481
+ * are not what you want.
482
+ *
483
+ * Fee style is either/or: give `gasPrice` for a legacy transaction, or `maxFeePerGas` /
484
+ * `maxPriorityFeePerGas` for an EIP-1559 one. Mixing the two does not typecheck. Anything left out
485
+ * is estimated.
486
+ */
474
487
  type TxParams = {
475
488
  gas?: bigint;
476
489
  nonce?: number;
@@ -505,5 +518,5 @@ type ChangeOwnershipReturnType = {
505
518
  txHash: Hash;
506
519
  };
507
520
  //#endregion
508
- export { OwnershipTransferredEvent as C, PredictEntityKeysReturnType as D, PredictEntityKeysParameters as E, PredictedEntityKey as O, ExpiryExtendedEvent as S, QueryReturnType as T, EntityCreatedEvent as _, MutateEntitiesParameters as a, EntityEventContext as b, PatchEntityReturnType as c, DeleteEntityParameters as d, DeleteEntityReturnType as f, WatchEntityEventsParameters as g, GetBlockTimingReturnType as h, MimeType as i, ExtendEntityParameters as l, CreateEntityReturnType as m, ChangeOwnershipReturnType as n, MutateEntitiesReturnType as o, CreateEntityParameters as p, TxParams as r, PatchEntityParameters as s, ChangeOwnershipParameters as t, ExtendEntityReturnType as u, EntityDeletedEvent as v, QueryOptions as w, EntityPatchedEvent as x, EntityEvent as y };
509
- //# sourceMappingURL=changeOwnership-B7bEgla4.d.cts.map
521
+ export { QueryOptions as C, PredictedEntityKey as D, PredictEntityKeysReturnType as E, GetBlockTimingReturnType as O, OwnershipTransferredEvent as S, PredictEntityKeysParameters as T, EntityDeletedEvent as _, ExecuteBatchParameters as a, EntityPatchedEvent as b, PatchEntityReturnType as c, DeleteEntityParameters as d, DeleteEntityReturnType as f, EntityCreatedEvent as g, WatchEntityEventsParameters as h, MimeType as i, ExtendEntityParameters as l, CreateEntityReturnType as m, ChangeOwnershipReturnType as n, ExecuteBatchReturnType as o, CreateEntityParameters as p, TxParams as r, PatchEntityParameters as s, ChangeOwnershipParameters as t, ExtendEntityReturnType as u, EntityEvent as v, QueryReturnType as w, ExpiryExtendedEvent as x, EntityEventContext as y };
522
+ //# sourceMappingURL=changeOwnership-BofkLnXJ.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"changeOwnership-BofkLnXJ.d.cts","names":[],"sources":["../src/actions/public/getBlockTiming.ts","../src/actions/public/predictEntityKeys.ts","../src/actions/public/query.ts","../src/types/events.ts","../src/actions/public/watchEntityEvents.ts","../src/actions/wallet/createEntity.ts","../src/actions/wallet/deleteEntity.ts","../src/actions/wallet/extendEntity.ts","../src/actions/wallet/patchEntity.ts","../src/actions/wallet/executeBatch.ts","../src/types/mimeTypes.ts","../src/types/txParams.ts","../src/actions/wallet/changeOwnership.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAKY,wBAAA;;;;;;;;;;;;AAAZ;KCaY,kBAAA;;OAEL;EAFK;AAYZ;;;;EAaU,IAAA,EAAA,MAAA;CAMA;;AAaE,KAhCA,2BAgC2B,CAAA,eAAA,MAAA,GAAA,MAAA,EAAA,eAAA,SA9Bb,SA8Ba,EAAA,GAAA,SAAA,GAAA,SA9BsB,SA8BtB,EAAA,GAAA,SAAA,CAAA,GAAA;EAEb;EAA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AAaU,KWpBE,yBAAA,GXoBF;EAMA,SAAA,EWzBG,GXyBH;EAAM,MAAA,EWxBN,IXwBM;AAahB,CAAA"}
@@ -1,7 +1,7 @@
1
- const require_errors = require('../errors-D-eJkGVc.cjs');
2
- const require_flags = require('../flags-Ct8k0gpB.cjs');
3
- const require_expiry = require('../expiry-BUYIXTGb.cjs');
4
- const require_entity = require('../entity-wfBnZd91.cjs');
1
+ const require_errors = require('../errors-DhV00966.cjs');
2
+ const require_flags = require('../flags-DCD26uhe.cjs');
3
+ const require_expiry = require('../expiry-CG9GhVXv.cjs');
4
+ const require_entity = require('../entity-DJ0Gml9c.cjs');
5
5
 
6
6
  exports.ENTITY_EVENTS_ABI = require_entity.ENTITY_EVENTS_ABI;
7
7
  exports.InvalidCreationFlagsError = require_errors.InvalidCreationFlagsError;
@@ -9,6 +9,7 @@ exports.InvalidExpiryError = require_errors.InvalidExpiryError;
9
9
  exports.InvalidSaltError = require_errors.InvalidSaltError;
10
10
  exports.MAX_EXPIRES_AT = require_expiry.MAX_EXPIRES_AT;
11
11
  exports.MAX_SALT = require_entity.MAX_SALT;
12
+ exports.NO_SALT = require_entity.NO_SALT;
12
13
  exports.NoRandomSourceError = require_errors.NoRandomSourceError;
13
14
  exports.OperationType = require_expiry.OperationType;
14
15
  exports.decodeCreationFlags = require_flags.decodeCreationFlags;
@@ -1,4 +1,4 @@
1
- import { a as randomSalt, c as InvalidCreationFlagsError, d as NoRandomSourceError, i as predictEntityKey, l as InvalidExpiryError, n as OperationType, o as ENTITY_EVENTS_ABI, r as MAX_SALT, s as EntityEventName, t as MAX_EXPIRES_AT, u as InvalidSaltError } from "../index-D0CmtiWT.cjs";
1
+ import { a as SaltInput, c as ENTITY_EVENTS_ABI, d as InvalidExpiryError, f as InvalidSaltError, i as NO_SALT, l as EntityEventName, n as OperationType, o as predictEntityKey, p as NoRandomSourceError, r as MAX_SALT, s as randomSalt, t as MAX_EXPIRES_AT, u as InvalidCreationFlagsError } from "../index-BGp2plHs.cjs";
2
2
  import { a as ResolvedExpiry, i as Lifetime, n as Expiry, o as resolveExpiry, r as ExpiryContext, s as toBlocks, t as EncodedExpiry } from "../expiry-DRV29F1r.cjs";
3
3
  import { i as encodeCreationFlags, n as ResolvedCreationFlags, r as decodeCreationFlags, t as CreationFlags } from "../flags-0Vl5rrHq.cjs";
4
- export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, OperationType, ResolvedCreationFlags, ResolvedExpiry, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
4
+ export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NO_SALT, NoRandomSourceError, OperationType, ResolvedCreationFlags, ResolvedExpiry, SaltInput, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
@@ -1,4 +1,4 @@
1
- import { a as randomSalt, c as InvalidCreationFlagsError, d as NoRandomSourceError, i as predictEntityKey, l as InvalidExpiryError, n as OperationType, o as ENTITY_EVENTS_ABI, r as MAX_SALT, s as EntityEventName, t as MAX_EXPIRES_AT, u as InvalidSaltError } from "../index-ClgIuxJ8.js";
1
+ import { a as SaltInput, c as ENTITY_EVENTS_ABI, d as InvalidExpiryError, f as InvalidSaltError, i as NO_SALT, l as EntityEventName, n as OperationType, o as predictEntityKey, p as NoRandomSourceError, r as MAX_SALT, s as randomSalt, t as MAX_EXPIRES_AT, u as InvalidCreationFlagsError } from "../index-ezMZ2-JH.js";
2
2
  import { a as ResolvedExpiry, i as Lifetime, n as Expiry, o as resolveExpiry, r as ExpiryContext, s as toBlocks, t as EncodedExpiry } from "../expiry-BxOlvVWC.js";
3
3
  import { i as encodeCreationFlags, n as ResolvedCreationFlags, r as decodeCreationFlags, t as CreationFlags } from "../flags-wmcMoAnN.js";
4
- export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, OperationType, ResolvedCreationFlags, ResolvedExpiry, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
4
+ export { CreationFlags, ENTITY_EVENTS_ABI, EncodedExpiry, EntityEventName, Expiry, ExpiryContext, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, Lifetime, MAX_EXPIRES_AT, MAX_SALT, NO_SALT, NoRandomSourceError, OperationType, ResolvedCreationFlags, ResolvedExpiry, SaltInput, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
@@ -1,6 +1,6 @@
1
- import { i as NoRandomSourceError, n as InvalidExpiryError, r as InvalidSaltError, t as InvalidCreationFlagsError } from "../errors-DGB8AgT2.js";
2
- import { n as encodeCreationFlags, t as decodeCreationFlags } from "../flags-ZtlvOIIk.js";
3
- import { a as OperationType, i as MAX_EXPIRES_AT, n as resolveExpiry, r as toBlocks } from "../expiry-DGRzrSan.js";
4
- import { i as randomSalt, n as MAX_SALT, r as predictEntityKey, t as ENTITY_EVENTS_ABI } from "../entity-CFhbAv0R.js";
1
+ import { i as NoRandomSourceError, n as InvalidExpiryError, r as InvalidSaltError, t as InvalidCreationFlagsError } from "../errors-D2E1GRjw.js";
2
+ import { n as encodeCreationFlags, t as decodeCreationFlags } from "../flags-DUT2gHEU.js";
3
+ import { a as OperationType, i as MAX_EXPIRES_AT, n as resolveExpiry, r as toBlocks } from "../expiry-Cgdb_dbq.js";
4
+ import { a as randomSalt, i as predictEntityKey, n as MAX_SALT, r as NO_SALT, t as ENTITY_EVENTS_ABI } from "../entity-CniBgBSd.js";
5
5
 
6
- export { ENTITY_EVENTS_ABI, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, MAX_EXPIRES_AT, MAX_SALT, NoRandomSourceError, OperationType, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
6
+ export { ENTITY_EVENTS_ABI, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, MAX_EXPIRES_AT, MAX_SALT, NO_SALT, NoRandomSourceError, OperationType, decodeCreationFlags, encodeCreationFlags, predictEntityKey, randomSalt, resolveExpiry, toBlocks };
@@ -1,11 +1,17 @@
1
- import { i as NoRandomSourceError, r as InvalidSaltError } from "./errors-DGB8AgT2.js";
2
- import { o as ARKIV_ADDRESS } from "./expiry-DGRzrSan.js";
1
+ import { i as NoRandomSourceError, r as InvalidSaltError } from "./errors-D2E1GRjw.js";
2
+ import { o as ARKIV_ADDRESS } from "./expiry-Cgdb_dbq.js";
3
3
  import { encodePacked, keccak256, parseAbi } from "viem";
4
4
 
5
5
  //#region src/entity/key.ts
6
6
  /** The widest salt the `uint128` wire field carries. */
7
7
  const MAX_SALT = 2n ** 128n - 1n;
8
8
  /**
9
+ * Opts a create out of salting, as {@link CreateEntityParameters.salt}: the key is then derived
10
+ * from the owner and its nonce alone, so anyone who knows both can work it out before the create
11
+ * lands.
12
+ */
13
+ const NO_SALT = Symbol("NO_SALT");
14
+ /**
9
15
  * A cryptographically random 128-bit salt — what {@link CreateEntityParameters.salt} defaults to.
10
16
  *
11
17
  * The salt exists for unpredictability, not uniqueness: the per-owner nonce already guarantees
@@ -22,6 +28,12 @@ function randomSalt() {
22
28
  for (const byte of bytes) salt = salt << 8n | BigInt(byte);
23
29
  return salt;
24
30
  }
31
+ /**
32
+ * Resolves a caller-supplied salt to a `uint128`.
33
+ */
34
+ function resolveSalt(salt) {
35
+ return salt === NO_SALT ? 0n : validateSalt(salt);
36
+ }
25
37
  /** Validates a caller-supplied salt against the `uint128` wire field. */
26
38
  function validateSalt(salt) {
27
39
  if (typeof salt !== "bigint" || salt < 0n || salt > MAX_SALT) throw new InvalidSaltError(salt);
@@ -47,7 +59,7 @@ function predictEntityKey({ owner, nonce, salt, chainId }) {
47
59
  ARKIV_ADDRESS,
48
60
  owner,
49
61
  nonce,
50
- validateSalt(salt)
62
+ resolveSalt(salt)
51
63
  ]));
52
64
  }
53
65
 
@@ -66,5 +78,5 @@ const ENTITY_EVENTS_ABI = parseAbi([
66
78
  ]);
67
79
 
68
80
  //#endregion
69
- export { validateSalt as a, randomSalt as i, MAX_SALT as n, predictEntityKey as r, ENTITY_EVENTS_ABI as t };
70
- //# sourceMappingURL=entity-CFhbAv0R.js.map
81
+ export { randomSalt as a, predictEntityKey as i, MAX_SALT as n, resolveSalt as o, NO_SALT as r, ENTITY_EVENTS_ABI as t };
82
+ //# sourceMappingURL=entity-CniBgBSd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity-CniBgBSd.js","names":[],"sources":["../src/entity/key.ts","../src/entity/events.ts"],"sourcesContent":["import { type Address, encodePacked, type Hex, keccak256 } from \"viem\"\nimport type { CreateEntityParameters } from \"../actions/wallet/createEntity\"\nimport { ARKIV_ADDRESS } from \"../consts\"\nimport { InvalidSaltError, NoRandomSourceError } from \"./errors\"\n\n/** The widest salt the `uint128` wire field carries. */\nexport const MAX_SALT = 2n ** 128n - 1n\n\n/**\n * Opts a create out of salting, as {@link CreateEntityParameters.salt}: the key is then derived\n * from the owner and its nonce alone, so anyone who knows both can work it out before the create\n * lands.\n */\nexport const NO_SALT = Symbol(\"NO_SALT\")\n\n/**\n * A salt as a caller expresses it: an explicit `uint128`, or {@link NO_SALT} to opt out of salting.\n */\nexport type SaltInput = bigint | typeof NO_SALT\n\n/**\n * A cryptographically random 128-bit salt — what {@link CreateEntityParameters.salt} defaults to.\n *\n * The salt exists for unpredictability, not uniqueness: the per-owner nonce already guarantees\n * distinct keys. Random bits mean only the creator can predict the key of an entity they are about\n * to create, so nobody else can reference or squat it in advance.\n *\n * @throws {NoRandomSourceError} If the runtime has no `crypto.getRandomValues`.\n */\nexport function randomSalt(): bigint {\n const source = globalThis.crypto\n if (typeof source?.getRandomValues !== \"function\") {\n throw new NoRandomSourceError()\n }\n const bytes = source.getRandomValues(new Uint8Array(16))\n let salt = 0n\n for (const byte of bytes) salt = (salt << 8n) | BigInt(byte)\n return salt\n}\n\n/**\n * Resolves a caller-supplied salt to a `uint128`.\n */\nexport function resolveSalt(salt: SaltInput): bigint {\n return salt === NO_SALT ? 0n : validateSalt(salt)\n}\n\n/** Validates a caller-supplied salt against the `uint128` wire field. */\nexport function validateSalt(salt: bigint): bigint {\n if (typeof salt !== \"bigint\" || salt < 0n || salt > MAX_SALT) {\n throw new InvalidSaltError(salt)\n }\n return salt\n}\n\n/**\n * The key an entity will be created with, derived exactly as the engine derives it:\n * `keccak256(domain ++ owner ++ nonce ++ salt)`.\n *\n * Deriving it client-side is what lets a batch compose: predict the key of a create, then have a\n * later operation in the same transaction reference it, or store it as a `key` attribute on a\n * sibling entity.\n */\nexport function predictEntityKey({\n owner,\n nonce,\n salt,\n chainId,\n}: {\n /** The account creating the entity. */\n owner: Address\n /**\n * The owner's entity-nonce at creation time. Each create in a batch consumes one, so the *n*th\n * create in a batch uses `nonce + n`.\n */\n nonce: bigint\n /** The salt the create will carry, or {@link NO_SALT} if it carries none. */\n salt: SaltInput\n /** The chain the entity is being created on — half of the derivation domain. */\n chainId: number\n}): Hex {\n return keccak256(\n encodePacked(\n [\"uint256\", \"address\", \"address\", \"uint64\", \"uint128\"],\n [BigInt(chainId), ARKIV_ADDRESS, owner, nonce, resolveSalt(salt)],\n ),\n )\n}\n","import { parseAbi } from \"viem\"\n\n/**\n * The events the engine emits: one per applied operation, in application order, so an off-chain\n * replica can replay a transaction operation by operation.\n */\nexport const ENTITY_EVENTS_ABI = parseAbi([\n \"event EntityCreated(bytes32 indexed entityKey, address indexed owner, uint64 expiresAt, uint8 creationFlags)\",\n \"event EntityPatched(bytes32 indexed entityKey, address indexed owner)\",\n \"event ExpiryExtended(bytes32 indexed entityKey, address indexed owner, uint64 expiresAt)\",\n \"event OwnershipTransferred(bytes32 indexed entityKey, address indexed previousOwner, address indexed newOwner)\",\n \"event EntityDeleted(bytes32 indexed entityKey, address indexed owner)\",\n])\n\n/** The name of each event in {@link ENTITY_EVENTS_ABI}. */\nexport type EntityEventName = (typeof ENTITY_EVENTS_ABI)[number][\"name\"]\n"],"mappings":";;;;;;AAMA,MAAa,WAAW,MAAM,OAAO;;;;;;AAOrC,MAAa,UAAU,OAAO,UAAU;;;;;;;;;;AAgBxC,SAAgB,aAAqB;CACnC,MAAM,SAAS,WAAW;AAC1B,KAAI,OAAO,QAAQ,oBAAoB,WACrC,OAAM,IAAI,qBAAqB;CAEjC,MAAM,QAAQ,OAAO,gBAAgB,IAAI,WAAW,GAAG,CAAC;CACxD,IAAI,OAAO;AACX,MAAK,MAAM,QAAQ,MAAO,QAAQ,QAAQ,KAAM,OAAO,KAAK;AAC5D,QAAO;;;;;AAMT,SAAgB,YAAY,MAAyB;AACnD,QAAO,SAAS,UAAU,KAAK,aAAa,KAAK;;;AAInD,SAAgB,aAAa,MAAsB;AACjD,KAAI,OAAO,SAAS,YAAY,OAAO,MAAM,OAAO,SAClD,OAAM,IAAI,iBAAiB,KAAK;AAElC,QAAO;;;;;;;;;;AAWT,SAAgB,iBAAiB,EAC/B,OACA,OACA,MACA,WAaM;AACN,QAAO,UACL,aACE;EAAC;EAAW;EAAW;EAAW;EAAU;EAAU,EACtD;EAAC,OAAO,QAAQ;EAAE;EAAe;EAAO;EAAO,YAAY,KAAK;EAAC,CAClE,CACF;;;;;;;;;AChFH,MAAa,oBAAoB,SAAS;CACxC;CACA;CACA;CACA;CACA;CACD,CAAC"}
@@ -1,11 +1,17 @@
1
- const require_errors = require('./errors-D-eJkGVc.cjs');
2
- const require_expiry = require('./expiry-BUYIXTGb.cjs');
1
+ const require_errors = require('./errors-DhV00966.cjs');
2
+ const require_expiry = require('./expiry-CG9GhVXv.cjs');
3
3
  let viem = require("viem");
4
4
 
5
5
  //#region src/entity/key.ts
6
6
  /** The widest salt the `uint128` wire field carries. */
7
7
  const MAX_SALT = 2n ** 128n - 1n;
8
8
  /**
9
+ * Opts a create out of salting, as {@link CreateEntityParameters.salt}: the key is then derived
10
+ * from the owner and its nonce alone, so anyone who knows both can work it out before the create
11
+ * lands.
12
+ */
13
+ const NO_SALT = Symbol("NO_SALT");
14
+ /**
9
15
  * A cryptographically random 128-bit salt — what {@link CreateEntityParameters.salt} defaults to.
10
16
  *
11
17
  * The salt exists for unpredictability, not uniqueness: the per-owner nonce already guarantees
@@ -22,6 +28,12 @@ function randomSalt() {
22
28
  for (const byte of bytes) salt = salt << 8n | BigInt(byte);
23
29
  return salt;
24
30
  }
31
+ /**
32
+ * Resolves a caller-supplied salt to a `uint128`.
33
+ */
34
+ function resolveSalt(salt) {
35
+ return salt === NO_SALT ? 0n : validateSalt(salt);
36
+ }
25
37
  /** Validates a caller-supplied salt against the `uint128` wire field. */
26
38
  function validateSalt(salt) {
27
39
  if (typeof salt !== "bigint" || salt < 0n || salt > MAX_SALT) throw new require_errors.InvalidSaltError(salt);
@@ -47,7 +59,7 @@ function predictEntityKey({ owner, nonce, salt, chainId }) {
47
59
  require_expiry.ARKIV_ADDRESS,
48
60
  owner,
49
61
  nonce,
50
- validateSalt(salt)
62
+ resolveSalt(salt)
51
63
  ]));
52
64
  }
53
65
 
@@ -78,6 +90,12 @@ Object.defineProperty(exports, 'MAX_SALT', {
78
90
  return MAX_SALT;
79
91
  }
80
92
  });
93
+ Object.defineProperty(exports, 'NO_SALT', {
94
+ enumerable: true,
95
+ get: function () {
96
+ return NO_SALT;
97
+ }
98
+ });
81
99
  Object.defineProperty(exports, 'predictEntityKey', {
82
100
  enumerable: true,
83
101
  get: function () {
@@ -90,9 +108,9 @@ Object.defineProperty(exports, 'randomSalt', {
90
108
  return randomSalt;
91
109
  }
92
110
  });
93
- Object.defineProperty(exports, 'validateSalt', {
111
+ Object.defineProperty(exports, 'resolveSalt', {
94
112
  enumerable: true,
95
113
  get: function () {
96
- return validateSalt;
114
+ return resolveSalt;
97
115
  }
98
116
  });
@@ -16,7 +16,7 @@ var InvalidCreationFlagsError = class extends Error {
16
16
  /** A key salt was outside the `uint128` the wire carries. */
17
17
  var InvalidSaltError = class extends Error {
18
18
  constructor(salt) {
19
- super(`Invalid salt ${salt}. A salt is a uint128, so it must be between 0 and ${2n ** 128n - 1n}. Omit it to get 128 random bits, or pass 0 for a predictable key.`);
19
+ super(`Invalid salt ${String(salt)}. A salt is a uint128, so it must be between 0 and ${2n ** 128n - 1n}. Omit it to get 128 random bits, or pass NO_SALT for a key derived from the owner and nonce alone.`);
20
20
  this.name = "InvalidSaltError";
21
21
  }
22
22
  };
@@ -30,4 +30,4 @@ var NoRandomSourceError = class extends Error {
30
30
 
31
31
  //#endregion
32
32
  export { NoRandomSourceError as i, InvalidExpiryError as n, InvalidSaltError as r, InvalidCreationFlagsError as t };
33
- //# sourceMappingURL=errors-DGB8AgT2.js.map
33
+ //# sourceMappingURL=errors-D2E1GRjw.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors-D2E1GRjw.js","names":[],"sources":["../src/entity/errors.ts"],"sourcesContent":["/** An expiry could not be expressed, or would be rejected by the engine. */\nexport class InvalidExpiryError extends Error {\n constructor(reason: string) {\n super(`Invalid expiry: ${reason}`)\n this.name = \"InvalidExpiryError\"\n }\n}\n\n/** A `creationFlags` byte could not be built or read. */\nexport class InvalidCreationFlagsError extends Error {\n constructor(reason: string) {\n super(`Invalid creation flags: ${reason}`)\n this.name = \"InvalidCreationFlagsError\"\n }\n}\n\n/** A key salt was outside the `uint128` the wire carries. */\nexport class InvalidSaltError extends Error {\n constructor(salt: unknown) {\n super(\n `Invalid salt ${String(salt)}. A salt is a uint128, so it must be between 0 and ` +\n `${2n ** 128n - 1n}. Omit it to get 128 random bits, or pass NO_SALT for a key derived ` +\n `from the owner and nonce alone.`,\n )\n this.name = \"InvalidSaltError\"\n }\n}\n\n/** No cryptographic randomness was available to generate a salt. */\nexport class NoRandomSourceError extends Error {\n constructor() {\n super(\n \"No cryptographic random source is available (globalThis.crypto.getRandomValues is \" +\n \"missing), so a key salt cannot be generated. Upgrade to Node 18+ or a modern browser, \" +\n \"or pass an explicit salt.\",\n )\n this.name = \"NoRandomSourceError\"\n }\n}\n"],"mappings":";;AACA,IAAa,qBAAb,cAAwC,MAAM;CAC5C,YAAY,QAAgB;AAC1B,QAAM,mBAAmB,SAAS;AAClC,OAAK,OAAO;;;;AAKhB,IAAa,4BAAb,cAA+C,MAAM;CACnD,YAAY,QAAgB;AAC1B,QAAM,2BAA2B,SAAS;AAC1C,OAAK,OAAO;;;;AAKhB,IAAa,mBAAb,cAAsC,MAAM;CAC1C,YAAY,MAAe;AACzB,QACE,gBAAgB,OAAO,KAAK,CAAC,qDACxB,MAAM,OAAO,GAAG,qGAEtB;AACD,OAAK,OAAO;;;;AAKhB,IAAa,sBAAb,cAAyC,MAAM;CAC7C,cAAc;AACZ,QACE,oMAGD;AACD,OAAK,OAAO"}
@@ -17,7 +17,7 @@ var InvalidCreationFlagsError = class extends Error {
17
17
  /** A key salt was outside the `uint128` the wire carries. */
18
18
  var InvalidSaltError = class extends Error {
19
19
  constructor(salt) {
20
- super(`Invalid salt ${salt}. A salt is a uint128, so it must be between 0 and ${2n ** 128n - 1n}. Omit it to get 128 random bits, or pass 0 for a predictable key.`);
20
+ super(`Invalid salt ${String(salt)}. A salt is a uint128, so it must be between 0 and ${2n ** 128n - 1n}. Omit it to get 128 random bits, or pass NO_SALT for a key derived from the owner and nonce alone.`);
21
21
  this.name = "InvalidSaltError";
22
22
  }
23
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"expiry-BxOlvVWC.d.ts","names":[],"sources":["../src/entity/expiry.ts"],"sourcesContent":[],"mappings":";;;AAsBA;AAiBA;AAaA;AAQA,cAnDc,SAmDY,EAAA,OAAA,MAAG;AAM7B;AAeA;;;;;AAmEA;;;;;KA9HY,MAAA;;;;;;;+BAOmB;YACnB,SAAA;;;;;;;;KASA,QAAA,GAAW;;;;KAaX,aAAA;;;;;;;KAQA,cAAA,GAAiB;;;;;KAMjB,aAAA;;;;;;;;;;;;;;iBAeI,aAAA,SAAsB,iBAAiB,gBAAgB;;;;;;;;;;;iBAmEvD,QAAA"}
1
+ {"version":3,"file":"expiry-BxOlvVWC.d.ts","names":[],"sources":["../src/entity/expiry.ts"],"sourcesContent":[],"mappings":";;;AAuBA;AAiBA;AAaA;AAQA,cAnDc,SAmDY,EAAA,OAAA,MAAG;AAM7B;AAeA;;;;;AAmEA;;;;;KA9HY,MAAA;;;;;;;+BAOmB;YACnB,SAAA;;;;;;;;KASA,QAAA,GAAW;;;;KAaX,aAAA;;;;;;;KAQA,cAAA,GAAiB;;;;;KAMjB,aAAA;;;;;;;;;;;;;;iBAeI,aAAA,SAAsB,iBAAiB,gBAAgB;;;;;;;;;;;iBAmEvD,QAAA"}
@@ -1,4 +1,4 @@
1
- const require_errors = require('./errors-D-eJkGVc.cjs');
1
+ const require_errors = require('./errors-DhV00966.cjs');
2
2
 
3
3
  //#region src/consts.ts
4
4
  const ARKIV_ADDRESS = "0x4400000000000000000000000000000000000044";
@@ -1,4 +1,4 @@
1
- import { n as InvalidExpiryError } from "./errors-DGB8AgT2.js";
1
+ import { n as InvalidExpiryError } from "./errors-D2E1GRjw.js";
2
2
 
3
3
  //#region src/consts.ts
4
4
  const ARKIV_ADDRESS = "0x4400000000000000000000000000000000000044";
@@ -92,4 +92,4 @@ function blockAtDate(date, currentBlock) {
92
92
 
93
93
  //#endregion
94
94
  export { OperationType as a, MAX_EXPIRES_AT as i, resolveExpiry as n, ARKIV_ADDRESS as o, toBlocks as r, BLOCK_TIME as s, makeExpiry as t };
95
- //# sourceMappingURL=expiry-DGRzrSan.js.map
95
+ //# sourceMappingURL=expiry-Cgdb_dbq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expiry-Cgdb_dbq.js","names":[],"sources":["../src/consts.ts","../src/entity/params.ts","../src/entity/expiry.ts"],"sourcesContent":["//export const ARKIV_ADDRESS = \"0x00000000000000000000000000000061726b6976\" as `0x${string}`\nexport const ARKIV_ADDRESS = \"0x4400000000000000000000000000000000000044\" as `0x${string}`\nexport const BLOCK_TIME = 2 // 2 seconds\n","/**\n * Max uint64 value\n */\nexport const MAX_EXPIRES_AT = 2n ** 64n - 1n\n\n/** The operation tags of the `execute` ABI's tagged union. */\nexport const OperationType = {\n Create: 1,\n Patch: 2,\n ExtendExpiry: 3,\n TransferOwnership: 4,\n Delete: 5,\n} as const\n\nexport type OperationType = (typeof OperationType)[keyof typeof OperationType]\n","import { BLOCK_TIME } from \"../consts\"\nimport type { ExpirationTime } from \"../utils/expirationTime\"\nimport { InvalidExpiryError } from \"./errors\"\nimport { MAX_EXPIRES_AT } from \"./params\"\n\n/**\n * The brand. Module-private and never exported, so the only way to obtain an {@link Expiry} is to\n * build one with {@link ExpirationTime} — a hand-written `{ minLifetime, expiresAt }` literal will\n * not typecheck, and neither will a bare number of seconds.\n */\ndeclare const validated: unique symbol\n\n/**\n * How long an entity should live.\n *\n * This is the pair the ABI carries, and the engine resolves it as\n * `max(expiresAt, currentBlock + minLifetime)` — whichever is later. Build one with\n * {@link ExpirationTime}; there is no other way to make one.\n *\n * Which slot a value lands in also decides which rules govern it. `minLifetime` is a duration, so\n * it must come to a whole number of blocks. `expiresAt` is a block height, which is a whole number\n * by construction, so a wall-clock date rounds into it rather than being rejected.\n */\nexport type Expiry = {\n /** Lifetime floor in blocks, counted from the block the transaction lands in. `0n` if unset. */\n readonly minLifetime: bigint\n /**\n * Absolute deadline: a block height, or a `Date` still to be placed against the current block.\n * `0n` if unset.\n */\n readonly expiresAt: bigint | Date\n readonly [validated]: true\n}\n\n/**\n * An expiry that is nothing but a duration — what the `ExpirationTime.from*` helpers return.\n *\n * Distinguished from a full {@link Expiry} by its `expiresAt` being the literal `0n`, which is what\n * keeps `atBlock(x, { atLeast: atBlock(y) })` from compiling: a deadline is not a floor.\n */\nexport type Lifetime = Expiry & { readonly expiresAt: 0n }\n\n/**\n * Builds a branded {@link Expiry}.\n *\n * Internal seam for {@link ExpirationTime}, which is the only thing that should call it — it is not\n * part of the package's public surface.\n */\nexport function makeExpiry(minLifetime: bigint, expiresAt: bigint | Date): Expiry {\n return { minLifetime, expiresAt } as Expiry\n}\n\n/** The two `uint256` values the ABI carries, with every `Date` already placed. */\nexport type EncodedExpiry = {\n /** Absolute target block height, or `0n` for a purely relative lifetime. */\n expiresAt: bigint\n /** Relative floor in blocks, or `0n` for a purely absolute expiry. */\n minLifetime: bigint\n}\n\n/** What an expiry resolves to, given the chain's current block. */\nexport type ResolvedExpiry = EncodedExpiry & {\n /** The block the entity will expire at — `max(expiresAt, currentBlock + minLifetime)`. */\n target: bigint\n}\n\n/** What the SDK needs to know about the chain to resolve an expiry. */\nexport type ExpiryContext = {\n currentBlock: bigint\n}\n\n/**\n * Resolves an expiry into the wire pair and the block the entity will expire at.\n *\n * Durations are converted to blocks at the nominal `BLOCK_TIME` (2 seconds), which makes them\n * **approximate**: block production is not a clock, so a lifetime asked for in days drifts if the\n * chain runs fast or slow. The block it was converted to comes back as\n * {@link ResolvedExpiry.target}, so the approximation is always observable rather than assumed.\n *\n * @throws {InvalidExpiryError} If the expiry is malformed, does not fit the `uint64` the wire\n * carries, or would leave the entity dead on arrival.\n */\nexport function resolveExpiry(expiry: Expiry, context: ExpiryContext): ResolvedExpiry {\n const { currentBlock } = context\n\n if (typeof expiry?.minLifetime !== \"bigint\" || expiry.expiresAt === undefined) {\n throw new InvalidExpiryError(\n \"expires must be built with ExpirationTime, e.g. ExpirationTime.fromDays(30) or \" +\n \"ExpirationTime.atBlock(1_200_000n)\",\n )\n }\n\n const { minLifetime } = expiry\n const absolute =\n typeof expiry.expiresAt === \"bigint\"\n ? expiry.expiresAt\n : blockAtDate(expiry.expiresAt, currentBlock)\n\n if (minLifetime === 0n && absolute === 0n) {\n throw new InvalidExpiryError(\n \"no expiry given. Pass ExpirationTime.fromDays(30) for a lifetime, \" +\n \"ExpirationTime.atBlock(n) for an absolute deadline, or a deadline with \" +\n \"{ atLeast } to take whichever is later.\",\n )\n }\n\n if (absolute > MAX_EXPIRES_AT) {\n throw new InvalidExpiryError(\n `expiresAt resolves to block ${absolute}, which does not fit the uint64 the wire carries ` +\n `(max ${MAX_EXPIRES_AT}). Use ExpirationTime.permanent() for an entity that should not ` +\n \"expire.\",\n )\n }\n if (minLifetime > MAX_EXPIRES_AT) {\n throw new InvalidExpiryError(\n `the lifetime is ${minLifetime} blocks, which does not fit the uint64 the wire carries ` +\n `(max ${MAX_EXPIRES_AT})`,\n )\n }\n\n const relative = minLifetime === 0n ? 0n : currentBlock + minLifetime\n const target = absolute > relative ? absolute : relative\n\n if (target <= currentBlock) {\n throw new InvalidExpiryError(\n `the entity would expire at block ${target}, which is not after the current block ` +\n `${currentBlock}, so it would be dead on arrival`,\n )\n }\n if (target > MAX_EXPIRES_AT) {\n throw new InvalidExpiryError(\n `a lifetime of ${minLifetime} blocks from block ${currentBlock} lands at ${target}, past ` +\n `the largest expiry the wire carries (${MAX_EXPIRES_AT})`,\n )\n }\n\n return { expiresAt: absolute, minLifetime, target }\n}\n\n/**\n * A duration in seconds as a whole number of blocks.\n *\n * Arkiv counts lifetimes in blocks, so a duration that is not a whole number of them does not\n * describe anything the chain can store. Rather than silently round a caller's `3` up to two blocks\n * — four seconds, not what they asked for — this rejects it: a duration must be a positive multiple\n * of `BLOCK_TIME` (2 seconds). The {@link ExpirationTime} helpers all produce such multiples.\n *\n * @throws {InvalidExpiryError} If the duration is not a positive whole number of blocks' seconds.\n */\nexport function toBlocks(seconds: number): bigint {\n if (!Number.isInteger(seconds) || seconds <= 0) {\n throw new InvalidExpiryError(\n `a lifetime must be a positive whole number of seconds, got ${seconds}. Use the ` +\n \"ExpirationTime helpers, e.g. ExpirationTime.fromDays(30).\",\n )\n }\n if (seconds % BLOCK_TIME !== 0) {\n throw new InvalidExpiryError(\n `a lifetime must be a multiple of the ${BLOCK_TIME}s block time, got ${seconds}, which is ` +\n `${seconds / BLOCK_TIME} blocks. Try ${seconds - (seconds % BLOCK_TIME)} or ` +\n `${seconds + BLOCK_TIME - (seconds % BLOCK_TIME)}, or ExpirationTime.fromBlocks(n).`,\n )\n }\n return BigInt(seconds / BLOCK_TIME)\n}\n\n/**\n * The block a wall-clock instant lands on.\n *\n * Rounds **up**: a date almost never falls on a block boundary, and unlike a duration — which the\n * caller states and can state exactly — there is nothing here to reject, so the entity lives until\n * at least the instant asked for.\n */\nfunction blockAtDate(date: Date, currentBlock: bigint): bigint {\n const secondsAway = (date.getTime() - Date.now()) / 1000\n if (secondsAway <= 0) {\n throw new InvalidExpiryError(\n `the deadline ${date.toISOString()} is in the past, so the entity would be dead on arrival`,\n )\n }\n return currentBlock + BigInt(Math.ceil(secondsAway / BLOCK_TIME))\n}\n"],"mappings":";;;AACA,MAAa,gBAAgB;AAC7B,MAAa,aAAa;;;;;;;ACC1B,MAAa,iBAAiB,MAAM,MAAM;;AAG1C,MAAa,gBAAgB;CAC3B,QAAQ;CACR,OAAO;CACP,cAAc;CACd,mBAAmB;CACnB,QAAQ;CACT;;;;;;;;;;ACoCD,SAAgB,WAAW,aAAqB,WAAkC;AAChF,QAAO;EAAE;EAAa;EAAW;;;;;;;;;;;;;AAiCnC,SAAgB,cAAc,QAAgB,SAAwC;CACpF,MAAM,EAAE,iBAAiB;AAEzB,KAAI,OAAO,QAAQ,gBAAgB,YAAY,OAAO,cAAc,OAClE,OAAM,IAAI,mBACR,oHAED;CAGH,MAAM,EAAE,gBAAgB;CACxB,MAAM,WACJ,OAAO,OAAO,cAAc,WACxB,OAAO,YACP,YAAY,OAAO,WAAW,aAAa;AAEjD,KAAI,gBAAgB,MAAM,aAAa,GACrC,OAAM,IAAI,mBACR,mLAGD;AAGH,KAAI,WAAW,eACb,OAAM,IAAI,mBACR,+BAA+B,SAAS,wDAC9B,eAAe,yEAE1B;AAEH,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;;;;KAMjB,aAAA;;;;;;;;;;;;;;iBAeI,aAAA,SAAsB,iBAAiB,gBAAgB;;;;;;;;;;;iBAmEvD,QAAA"}
1
+ {"version":3,"file":"expiry-DRV29F1r.d.cts","names":[],"sources":["../src/entity/expiry.ts"],"sourcesContent":[],"mappings":";;;AAuBA;AAiBA;AAaA;AAQA,cAnDc,SAmDY,EAAA,OAAA,MAAG;AAM7B;AAeA;;;;;AAmEA;;;;;KA9HY,MAAA;;;;;;;+BAOmB;YACnB,SAAA;;;;;;;;KASA,QAAA,GAAW;;;;KAaX,aAAA;;;;;;;KAQA,cAAA,GAAiB;;;;;KAMjB,aAAA;;;;;;;;;;;;;;iBAeI,aAAA,SAAsB,iBAAiB,gBAAgB;;;;;;;;;;;iBAmEvD,QAAA"}
@@ -1,4 +1,4 @@
1
- const require_errors = require('./errors-D-eJkGVc.cjs');
1
+ const require_errors = require('./errors-DhV00966.cjs');
2
2
 
3
3
  //#region src/entity/flags.ts
4
4
  /** Bit positions in the `creationFlags` byte. Bits 2-7 are reserved and must be zero. */
@@ -1,4 +1,4 @@
1
- import { t as InvalidCreationFlagsError } from "./errors-DGB8AgT2.js";
1
+ import { t as InvalidCreationFlagsError } from "./errors-D2E1GRjw.js";
2
2
 
3
3
  //#region src/entity/flags.ts
4
4
  /** Bit positions in the `creationFlags` byte. Bits 2-7 are reserved and must be zero. */
@@ -30,4 +30,4 @@ function decodeCreationFlags(raw) {
30
30
 
31
31
  //#endregion
32
32
  export { encodeCreationFlags as n, decodeCreationFlags as t };
33
- //# sourceMappingURL=flags-ZtlvOIIk.js.map
33
+ //# sourceMappingURL=flags-DUT2gHEU.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"flags-ZtlvOIIk.js","names":[],"sources":["../src/entity/flags.ts"],"sourcesContent":["import { InvalidCreationFlagsError } from \"./errors\"\n\n/** Bit positions in the `creationFlags` byte. Bits 2-7 are reserved and must be zero. */\nconst READONLY_BIT = 0b0000_0001\nconst PERMISSIONLESS_EXTENSION_BIT = 0b0000_0010\n\n/**\n * The immutable properties an entity is created with. Both default to `false`.\n *\n * Creation flags are fixed at creation: there is no operation that changes them, so an entity is\n * whatever it was created as for its whole life.\n */\nexport type CreationFlags = {\n /**\n * The entity's attributes and payload can never be changed — only its expiry extended, its\n * ownership transferred, and the entity deleted.\n */\n readonly?: boolean\n /**\n * Anyone, not just the owner, may extend the entity's expiry. Lets a third party keep something\n * alive without being able to change it.\n */\n permissionlessExtension?: boolean\n}\n\n/** {@link CreationFlags} as read back, with every flag resolved and the raw byte alongside. */\nexport type ResolvedCreationFlags = {\n readonly: boolean\n permissionlessExtension: boolean\n raw: number\n}\n\n/**\n * Packs creation flags into the `creationFlags` byte.\n *\n * @throws {InvalidCreationFlagsError} If a value is not a boolean.\n */\nexport function encodeCreationFlags(flags: CreationFlags = {}): number {\n for (const [name, value] of Object.entries(flags)) {\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new InvalidCreationFlagsError(`\"${name}\" must be a boolean, got ${typeof value}`)\n }\n }\n return (\n (flags.readonly ? READONLY_BIT : 0) |\n (flags.permissionlessExtension ? PERMISSIONLESS_EXTENSION_BIT : 0)\n )\n}\n\n/**\n * Reads the `creationFlags` byte back.\n *\n * @param raw - The `creationFlags` byte.\n * @throws {InvalidCreationFlagsError} Malformed input\n */\nexport function decodeCreationFlags(raw: number): ResolvedCreationFlags {\n if (!Number.isInteger(raw) || raw < 0 || raw > 0xff) {\n throw new InvalidCreationFlagsError(`${raw} is not a byte`)\n }\n return {\n readonly: (raw & READONLY_BIT) !== 0,\n permissionlessExtension: (raw & PERMISSIONLESS_EXTENSION_BIT) !== 0,\n raw,\n }\n}\n"],"mappings":";;;;AAGA,MAAM,eAAe;AACrB,MAAM,+BAA+B;;;;;;AAiCrC,SAAgB,oBAAoB,QAAuB,EAAE,EAAU;AACrE,MAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,CAC/C,KAAI,UAAU,UAAa,OAAO,UAAU,UAC1C,OAAM,IAAI,0BAA0B,IAAI,KAAK,2BAA2B,OAAO,QAAQ;AAG3F,SACG,MAAM,WAAW,eAAe,MAChC,MAAM,0BAA0B,+BAA+B;;;;;;;;AAUpE,SAAgB,oBAAoB,KAAoC;AACtE,KAAI,CAAC,OAAO,UAAU,IAAI,IAAI,MAAM,KAAK,MAAM,IAC7C,OAAM,IAAI,0BAA0B,GAAG,IAAI,gBAAgB;AAE7D,QAAO;EACL,WAAW,MAAM,kBAAkB;EACnC,0BAA0B,MAAM,kCAAkC;EAClE;EACD"}
1
+ {"version":3,"file":"flags-DUT2gHEU.js","names":[],"sources":["../src/entity/flags.ts"],"sourcesContent":["import { InvalidCreationFlagsError } from \"./errors\"\n\n/** Bit positions in the `creationFlags` byte. Bits 2-7 are reserved and must be zero. */\nconst READONLY_BIT = 0b0000_0001\nconst PERMISSIONLESS_EXTENSION_BIT = 0b0000_0010\n\n/**\n * The immutable properties an entity is created with. Both default to `false`.\n *\n * Creation flags are fixed at creation: there is no operation that changes them, so an entity is\n * whatever it was created as for its whole life.\n */\nexport type CreationFlags = {\n /**\n * The entity's attributes and payload can never be changed — only its expiry extended, its\n * ownership transferred, and the entity deleted.\n */\n readonly?: boolean\n /**\n * Anyone, not just the owner, may extend the entity's expiry. Lets a third party keep something\n * alive without being able to change it.\n */\n permissionlessExtension?: boolean\n}\n\n/** {@link CreationFlags} as read back, with every flag resolved and the raw byte alongside. */\nexport type ResolvedCreationFlags = {\n readonly: boolean\n permissionlessExtension: boolean\n raw: number\n}\n\n/**\n * Packs creation flags into the `creationFlags` byte.\n *\n * @throws {InvalidCreationFlagsError} If a value is not a boolean.\n */\nexport function encodeCreationFlags(flags: CreationFlags = {}): number {\n for (const [name, value] of Object.entries(flags)) {\n if (value !== undefined && typeof value !== \"boolean\") {\n throw new InvalidCreationFlagsError(`\"${name}\" must be a boolean, got ${typeof value}`)\n }\n }\n return (\n (flags.readonly ? READONLY_BIT : 0) |\n (flags.permissionlessExtension ? PERMISSIONLESS_EXTENSION_BIT : 0)\n )\n}\n\n/**\n * Reads the `creationFlags` byte back.\n *\n * @param raw - The `creationFlags` byte.\n * @throws {InvalidCreationFlagsError} Malformed input\n */\nexport function decodeCreationFlags(raw: number): ResolvedCreationFlags {\n if (!Number.isInteger(raw) || raw < 0 || raw > 0xff) {\n throw new InvalidCreationFlagsError(`${raw} is not a byte`)\n }\n return {\n readonly: (raw & READONLY_BIT) !== 0,\n permissionlessExtension: (raw & PERMISSIONLESS_EXTENSION_BIT) !== 0,\n raw,\n }\n}\n"],"mappings":";;;;AAGA,MAAM,eAAe;AACrB,MAAM,+BAA+B;;;;;;AAiCrC,SAAgB,oBAAoB,QAAuB,EAAE,EAAU;AACrE,MAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,MAAM,CAC/C,KAAI,UAAU,UAAa,OAAO,UAAU,UAC1C,OAAM,IAAI,0BAA0B,IAAI,KAAK,2BAA2B,OAAO,QAAQ;AAG3F,SACG,MAAM,WAAW,eAAe,MAChC,MAAM,0BAA0B,+BAA+B;;;;;;;;AAUpE,SAAgB,oBAAoB,KAAoC;AACtE,KAAI,CAAC,OAAO,UAAU,IAAI,IAAI,MAAM,KAAK,MAAM,IAC7C,OAAM,IAAI,0BAA0B,GAAG,IAAI,gBAAgB;AAE7D,QAAO;EACL,WAAW,MAAM,kBAAkB;EACnC,0BAA0B,MAAM,kCAAkC;EAClE;EACD"}
@@ -11,7 +11,7 @@ declare class InvalidCreationFlagsError extends Error {
11
11
  }
12
12
  /** A key salt was outside the `uint128` the wire carries. */
13
13
  declare class InvalidSaltError extends Error {
14
- constructor(salt: bigint);
14
+ constructor(salt: unknown);
15
15
  }
16
16
  /** No cryptographic randomness was available to generate a salt. */
17
17
  declare class NoRandomSourceError extends Error {
@@ -103,6 +103,16 @@ type EntityEventName = (typeof ENTITY_EVENTS_ABI)[number]["name"];
103
103
  //#region src/entity/key.d.ts
104
104
  /** The widest salt the `uint128` wire field carries. */
105
105
  declare const MAX_SALT: bigint;
106
+ /**
107
+ * Opts a create out of salting, as {@link CreateEntityParameters.salt}: the key is then derived
108
+ * from the owner and its nonce alone, so anyone who knows both can work it out before the create
109
+ * lands.
110
+ */
111
+ declare const NO_SALT: unique symbol;
112
+ /**
113
+ * A salt as a caller expresses it: an explicit `uint128`, or {@link NO_SALT} to opt out of salting.
114
+ */
115
+ type SaltInput = bigint | typeof NO_SALT;
106
116
  /**
107
117
  * A cryptographically random 128-bit salt — what {@link CreateEntityParameters.salt} defaults to.
108
118
  *
@@ -134,8 +144,8 @@ declare function predictEntityKey({
134
144
  * create in a batch uses `nonce + n`.
135
145
  */
136
146
  nonce: bigint;
137
- /** The salt the create will carry. */
138
- salt: bigint;
147
+ /** The salt the create will carry, or {@link NO_SALT} if it carries none. */
148
+ salt: SaltInput;
139
149
  /** The chain the entity is being created on — half of the derivation domain. */
140
150
  chainId: number;
141
151
  }): Hex;
@@ -155,5 +165,5 @@ declare const OperationType: {
155
165
  };
156
166
  type OperationType = (typeof OperationType)[keyof typeof OperationType];
157
167
  //#endregion
158
- export { randomSalt as a, InvalidCreationFlagsError as c, NoRandomSourceError as d, predictEntityKey as i, InvalidExpiryError as l, OperationType as n, ENTITY_EVENTS_ABI as o, MAX_SALT as r, EntityEventName as s, MAX_EXPIRES_AT as t, InvalidSaltError as u };
159
- //# sourceMappingURL=index-D0CmtiWT.d.cts.map
168
+ export { SaltInput as a, ENTITY_EVENTS_ABI as c, InvalidExpiryError as d, InvalidSaltError as f, NO_SALT as i, EntityEventName as l, OperationType as n, predictEntityKey as o, NoRandomSourceError as p, MAX_SALT as r, randomSalt as s, MAX_EXPIRES_AT as t, InvalidCreationFlagsError as u };
169
+ //# sourceMappingURL=index-BGp2plHs.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BGp2plHs.d.cts","names":[],"sources":["../src/entity/errors.ts","../src/entity/events.ts","../src/entity/key.ts","../src/entity/params.ts"],"sourcesContent":[],"mappings":";;;;cACa,kBAAA,SAA2B,KAA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BA,SAAA,MAAA,EAAA,CAAA;AASb,CAAA;KEDY,aAAA,WAAwB,4BAA4B"}
@@ -1,5 +1,5 @@
1
- import { K as TypeTag } from "./index-DVYFaXNV.js";
2
- import { R as RpcSelect, d as Expression, i as SelectArg, j as ArkivClient, k as Entity } from "./selection-fpmI3ADQ.js";
1
+ import { K as TypeTag } from "./index-Cd2aaWme.js";
2
+ import { R as RpcSelect, d as Expression, i as SelectArg, j as ArkivClient, k as Entity } from "./selection-ox7zdtVm.js";
3
3
  import { Hex } from "viem";
4
4
 
5
5
  //#region src/query/engine.d.ts
@@ -43,7 +43,7 @@ declare function runQuery(client: ArkivClient, request: QueryRequest): Promise<Q
43
43
  * | | `=` `!=` | `<` `<=` `>` `>=` | `STARTSWITH` |
44
44
  * | --- | --- | --- | --- |
45
45
  * | `bool` | yes | no | no |
46
- * | `i32` `u256` `dec` | yes | yes | no |
46
+ * | `i32` `u64` `u256` `dec` | yes | yes | no |
47
47
  * | `str` | yes | no | yes |
48
48
  * | `addr` `key` `bytes32` | yes | no | no |
49
49
  */
@@ -275,4 +275,4 @@ declare class SelectQueryBuilder<TEntity = Entity> {
275
275
  }
276
276
  //#endregion
277
277
  export { QueryErrorKind as a, QueryRequest as c, QueryError as i, QueryResponse as l, QueryResult as n, UnsupportedOperatorError as o, InvalidPredicateError as r, MAX_LIMIT as s, SelectQueryBuilder as t, runQuery as u };
278
- //# sourceMappingURL=index-VCqgn29D.d.ts.map
278
+ //# sourceMappingURL=index-BKB875Um.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-VCqgn29D.d.ts","names":[],"sources":["../src/query/engine.ts","../src/query/errors.ts","../src/query/queryResult.ts","../src/query/queryBuilder.ts"],"sourcesContent":[],"mappings":";;;;;cAUa,SAAA;;AAAA,KAGD,YAAA,GAHU;EAGV;EAcA,KAAA,EAAA,MAAA;EAaU;EAAiB,MAAA,EAvB7B,SAuB6B;EAAsB;EAAuB,KAAA,CAAA,EAAA,MAAA,GAAA,SAA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OAAA,CAAQ,WAAR,CAAoB,OAApB,CAAA,CAAA;;;;AFrDhB;AAcA;AAaA;;;;;;;;;ACxBA;;;;;AAyBA;AAgBA;AAwCA;;;;;;;;AChG6C;;;;AAGQ,cCqCxC,kBDrCwC,CAAA,UCqCX,MDrCW,CAAA,CAAA;EAgBxC,iBAAW,OAAA;EAAW,iBAAA,OAAA;EAEL,iBAAA,QAAA;EAcP,QAAA,QAAA;EAGE,QAAA,UAAA;EAAV,QAAA,MAAA;EA2BqB,QAAA,OAAA;EAAZ,QAAA,QAAA;EAAR,WAAA,CAAA,MAAA,ECfM,WDeN,EAAA,SAAA,CAAA,ECf+B,SDe/B;EAAO;;;;ACzBvB;;;;;;EAuCiB,KAAA,CAAA,WAAA,EAAA,SAda,UAcb,EAAA,CAAA,EAAA,IAAA;EAWI,KAAA,CAAA,GAAA,WAAA,EAxBG,UAwBH,EAAA,CAAA,EAAA,IAAA;EAuEgB;;;;;;;iBAlFpB;;;;;;;qBAWI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAuEJ,QAAQ,YAAY;;;;;;;;;GAqB3B,MAAA,CAAO,aAAA,KAAkB,eAAe"}
1
+ {"version":3,"file":"index-BKB875Um.d.ts","names":[],"sources":["../src/query/engine.ts","../src/query/errors.ts","../src/query/queryResult.ts","../src/query/queryBuilder.ts"],"sourcesContent":[],"mappings":";;;;;cAUa,SAAA;;AAAA,KAGD,YAAA,GAHU;EAGV;EAcA,KAAA,EAAA,MAAA;EAaU;EAAiB,MAAA,EAvB7B,SAuB6B;EAAsB;EAAuB,KAAA,CAAA,EAAA,MAAA,GAAA,SAAA;EAAR;EAAO,MAAA,CAAA,EAAA,MAAA,GAAA,SAAA;;;;ACxBnF;AAMgB,KDKJ,aAAA,GCLI;EAE4C,QAAA,EDIhD,MCJgD,EAAA;EARd;EAAK,WAAA,EAAA,MAAA;EAyBtC;EAgBD,MAAA,EAAA,MAAA,GAAc,SAAA;AAwC1B,CAAA;;;;;;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