@arkiv-network/sdk 0.8.1-dev.1 → 0.9.0-next.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 (184) hide show
  1. package/README.md +180 -61
  2. package/dist/chains/index.d.ts +17 -17
  3. package/dist/changeOwnership-Cy9gfyjN.d.cts +1160 -0
  4. package/dist/changeOwnership-Cy9gfyjN.d.cts.map +1 -0
  5. package/dist/changeOwnership-gXf-lBqI.d.ts +1160 -0
  6. package/dist/changeOwnership-gXf-lBqI.d.ts.map +1 -0
  7. package/dist/entity/index.cjs +4 -10
  8. package/dist/entity/index.d.cts +3 -3
  9. package/dist/entity/index.d.ts +3 -3
  10. package/dist/entity/index.js +3 -4
  11. package/dist/entity-BM1unrQf.cjs +41 -0
  12. package/dist/{entity-DJ0Gml9c.cjs → entity-BgaFJSaV.cjs} +4 -4
  13. package/dist/entity-CFAI1KyG.js +36 -0
  14. package/dist/entity-CFAI1KyG.js.map +1 -0
  15. package/dist/{entity-CniBgBSd.js → entity-CGqx_AU0.js} +4 -4
  16. package/dist/entity-CGqx_AU0.js.map +1 -0
  17. package/dist/{payload-AfUfSctb.d.ts → expirationTime-C7PZK49K.d.ts} +8 -37
  18. package/dist/expirationTime-C7PZK49K.d.ts.map +1 -0
  19. package/dist/expirationTime-CkIGNAg8.cjs +140 -0
  20. package/dist/{payload-D167BlJR.d.cts → expirationTime-DOB8V4B8.d.cts} +8 -37
  21. package/dist/expirationTime-DOB8V4B8.d.cts.map +1 -0
  22. package/dist/{expiry-Cgdb_dbq.js → expirationTime-UKPuA-LM.js} +62 -27
  23. package/dist/expirationTime-UKPuA-LM.js.map +1 -0
  24. package/dist/expiry-B48I-yTA.d.cts +40 -0
  25. package/dist/expiry-B48I-yTA.d.cts.map +1 -0
  26. package/dist/expiry-S2PUL8Hg.d.ts +40 -0
  27. package/dist/expiry-S2PUL8Hg.d.ts.map +1 -0
  28. package/dist/index-C-mMF5WZ.d.cts +735 -0
  29. package/dist/index-C-mMF5WZ.d.cts.map +1 -0
  30. package/dist/{index-BkqSnGJH.d.ts → index-C4zZqJ9S.d.ts} +5 -27
  31. package/dist/index-C4zZqJ9S.d.ts.map +1 -0
  32. package/dist/{index-CLhsFyVH.d.cts → index-CcVWYB6v.d.cts} +5 -27
  33. package/dist/index-CcVWYB6v.d.cts.map +1 -0
  34. package/dist/index-DCx2XC6S.d.ts +489 -0
  35. package/dist/index-DCx2XC6S.d.ts.map +1 -0
  36. package/dist/index-DLb7BfIw.d.ts +735 -0
  37. package/dist/index-DLb7BfIw.d.ts.map +1 -0
  38. package/dist/index-DzriOUm8.d.cts +489 -0
  39. package/dist/index-DzriOUm8.d.cts.map +1 -0
  40. package/dist/index.cjs +162 -146
  41. package/dist/index.d.cts +180 -133
  42. package/dist/index.d.cts.map +1 -1
  43. package/dist/index.d.ts +180 -133
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +93 -83
  46. package/dist/index.js.map +1 -1
  47. package/dist/params-BuIrJA9a.cjs +45 -0
  48. package/dist/params-DDJOnsNi.js +22 -0
  49. package/dist/params-DDJOnsNi.js.map +1 -0
  50. package/dist/query/index.cjs +9 -4
  51. package/dist/query/index.d.cts +6 -6
  52. package/dist/query/index.d.ts +6 -6
  53. package/dist/query/index.js +4 -5
  54. package/dist/query-D0KtuFh2.cjs +1625 -0
  55. package/dist/query-DpRDozmj.js +1417 -0
  56. package/dist/query-DpRDozmj.js.map +1 -0
  57. package/dist/schema/index.cjs +46 -0
  58. package/dist/schema/index.d.cts +2 -0
  59. package/dist/schema/index.d.ts +2 -0
  60. package/dist/schema/index.js +3 -0
  61. package/dist/{attr-BXTkpnoc.cjs → schema-B9AyXcgU.cjs} +513 -246
  62. package/dist/{attr-tmyREHtw.js → schema-DY4sqehl.js} +427 -244
  63. package/dist/schema-DY4sqehl.js.map +1 -0
  64. package/dist/types/index.cjs +1 -1
  65. package/dist/types/index.d.cts +5 -5
  66. package/dist/types/index.d.ts +5 -5
  67. package/dist/types/index.js +1 -1
  68. package/dist/utils/index.cjs +3 -5
  69. package/dist/utils/index.d.cts +3 -3
  70. package/dist/utils/index.d.ts +3 -3
  71. package/dist/utils/index.js +3 -3
  72. package/package.json +9 -12
  73. package/src/actions/public/getEntity.test.ts +69 -0
  74. package/src/actions/public/getEntity.ts +34 -20
  75. package/src/actions/public/predictEntityKeys.ts +8 -7
  76. package/src/actions/public/query.test.ts +58 -0
  77. package/src/actions/public/query.ts +41 -13
  78. package/src/actions/wallet/createEntity.ts +34 -63
  79. package/src/actions/wallet/executeBatch.test.ts +38 -0
  80. package/src/actions/wallet/executeBatch.ts +26 -9
  81. package/src/actions/wallet/extendEntity.ts +9 -8
  82. package/src/actions/wallet/patchEntity.ts +43 -52
  83. package/src/clients/createPublicClient.test.ts +10 -2
  84. package/src/clients/createWalletClient.ts +4 -1
  85. package/src/clients/decorators/arkivPublic.ts +123 -80
  86. package/src/clients/decorators/arkivWallet.ts +113 -65
  87. package/src/entity/create.test.ts +25 -21
  88. package/src/entity/expiry.ts +8 -6
  89. package/src/entity/flags.ts +1 -1
  90. package/src/entity/index.ts +2 -4
  91. package/src/entity/key.ts +3 -3
  92. package/src/entity/operations.ts +1 -1
  93. package/src/errors.ts +2 -11
  94. package/src/index.ts +18 -6
  95. package/src/query/builderBase.ts +166 -0
  96. package/src/query/countBuilder.test.ts +91 -0
  97. package/src/query/countBuilder.ts +67 -0
  98. package/src/query/engine.ts +9 -3
  99. package/src/query/errors.ts +24 -14
  100. package/src/query/expression.test.ts +129 -21
  101. package/src/query/expression.ts +323 -94
  102. package/src/query/index.ts +26 -4
  103. package/src/query/injection.test.ts +5 -11
  104. package/src/query/queryBuilder.test.ts +467 -58
  105. package/src/query/queryBuilder.ts +191 -98
  106. package/src/query/queryResult.ts +35 -9
  107. package/src/query/selection.test.ts +278 -24
  108. package/src/query/selection.ts +427 -86
  109. package/src/schema/attributes.test.ts +266 -0
  110. package/src/schema/attributes.ts +212 -0
  111. package/src/{attr → schema}/codec.test.ts +37 -5
  112. package/src/{attr → schema}/codec.ts +40 -11
  113. package/src/schema/column.ts +193 -0
  114. package/src/{attr → schema}/errors.ts +67 -10
  115. package/src/schema/index.ts +76 -0
  116. package/src/{attr → schema}/names.ts +4 -2
  117. package/src/schema/schema.test.ts +171 -0
  118. package/src/schema/schema.ts +250 -0
  119. package/src/{attr → schema}/types.ts +36 -30
  120. package/src/{attr → schema}/values.test.ts +62 -3
  121. package/src/{attr → schema}/values.ts +246 -65
  122. package/src/types/entity.test.ts +1 -44
  123. package/src/types/entity.ts +9 -55
  124. package/src/types/events.ts +1 -1
  125. package/src/types/index.ts +11 -4
  126. package/src/types/rpcSchema.ts +22 -16
  127. package/src/utils/arkivTransactions.test.ts +356 -116
  128. package/src/utils/arkivTransactions.ts +30 -38
  129. package/src/utils/entities.ts +10 -9
  130. package/src/utils/expirationTime.ts +5 -5
  131. package/src/utils/index.ts +0 -1
  132. package/src/utils/logger.test.ts +45 -0
  133. package/src/utils/logger.ts +5 -39
  134. package/src/utils/revert.test.ts +25 -0
  135. package/src/utils/revert.ts +28 -3
  136. package/dist/attr/index.cjs +0 -34
  137. package/dist/attr/index.d.cts +0 -2
  138. package/dist/attr/index.d.ts +0 -2
  139. package/dist/attr/index.js +0 -3
  140. package/dist/attr-tmyREHtw.js.map +0 -1
  141. package/dist/entity-B0t6sN7F.cjs +0 -71
  142. package/dist/entity-BIp_df9u.js +0 -67
  143. package/dist/entity-BIp_df9u.js.map +0 -1
  144. package/dist/entity-CniBgBSd.js.map +0 -1
  145. package/dist/expiry-BxOlvVWC.d.ts +0 -79
  146. package/dist/expiry-BxOlvVWC.d.ts.map +0 -1
  147. package/dist/expiry-CG9GhVXv.cjs +0 -135
  148. package/dist/expiry-Cgdb_dbq.js.map +0 -1
  149. package/dist/expiry-DRV29F1r.d.cts +0 -79
  150. package/dist/expiry-DRV29F1r.d.cts.map +0 -1
  151. package/dist/flags-DCD26uhe.cjs +0 -43
  152. package/dist/flags-DUT2gHEU.js +0 -33
  153. package/dist/flags-DUT2gHEU.js.map +0 -1
  154. package/dist/index-BkqSnGJH.d.ts.map +0 -1
  155. package/dist/index-C7fbakoI.d.cts +0 -278
  156. package/dist/index-C7fbakoI.d.cts.map +0 -1
  157. package/dist/index-CIcHPx2j.d.cts +0 -424
  158. package/dist/index-CIcHPx2j.d.cts.map +0 -1
  159. package/dist/index-CLhsFyVH.d.cts.map +0 -1
  160. package/dist/index-Cd2aaWme.d.ts +0 -424
  161. package/dist/index-Cd2aaWme.d.ts.map +0 -1
  162. package/dist/index-Cq6fa8AI.d.ts +0 -278
  163. package/dist/index-Cq6fa8AI.d.ts.map +0 -1
  164. package/dist/index-DaNeJUw8.d.ts +0 -955
  165. package/dist/index-DaNeJUw8.d.ts.map +0 -1
  166. package/dist/index-Dv16LO2s.d.cts +0 -955
  167. package/dist/index-Dv16LO2s.d.cts.map +0 -1
  168. package/dist/payload-AfUfSctb.d.ts.map +0 -1
  169. package/dist/payload-D167BlJR.d.cts.map +0 -1
  170. package/dist/payload-DE7wMztL.js +0 -92
  171. package/dist/payload-DE7wMztL.js.map +0 -1
  172. package/dist/payload-DqFweqiO.cjs +0 -108
  173. package/dist/query-9oojUdM7.cjs +0 -1128
  174. package/dist/query-Ber-lOJQ.js +0 -968
  175. package/dist/query-Ber-lOJQ.js.map +0 -1
  176. package/src/actions/public/getEntityCount.ts +0 -10
  177. package/src/attr/attributes.test.ts +0 -120
  178. package/src/attr/attributes.ts +0 -196
  179. package/src/attr/index.ts +0 -50
  180. package/src/types/mimeTypes.ts +0 -27
  181. package/src/utils/compression.test.ts +0 -32
  182. package/src/utils/compression.ts +0 -102
  183. package/src/utils/payload.ts +0 -36
  184. /package/src/{attr → schema}/decimal.ts +0 -0
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
- import { A as i32, B as Bytes32Value, C as ValueInput, D as dec, E as bytes32, F as u64, G as StrValue, H as DecValue, I as AddrValue, J as U64Value, K as TypeTag, L as AnyArkivValue, M as str, N as toValue, O as decFromUnits, P as u256, R as ArkivValue, S as U64_MAX, T as bool, U as I32Value, V as BytesValue, W as KeyValue, X as isArkivValue, Y as UserTypeTag, _ as MAX_PAYLOAD_BYTES, a as InvalidAttributeNameError, b as MAX_STRING_BYTES, c as TooManyAttributesError, d as DECIMAL_SCALE, f as DECIMAL_UNIT, g as MAX_ATTRIBUTES, h as Attributes, i as ConflictingMutationError, j as key, k as decUnits, l as UnknownAttributeTypeError, m as AttributeSchema, n as isValidAttributeName, o as InvalidValueError, p as AttributeInputs, q as U256Value, r as validateAttributeName, s as MissingValueError, t as MAX_NAME_BYTES, u as UntypedValueError, v as I32_MAX, w as addr, x as U256_MAX, y as I32_MIN, z as BoolValue } from "./index-CIcHPx2j.cjs";
2
- import { _ as NoRandomSourceError, a as SaltInput, c as CreationFlags, d as encodeCreationFlags, f as ENTITY_EVENTS_ABI, g as InvalidSaltError, h as InvalidExpiryError, i as NO_SALT, l as ResolvedCreationFlags, m as InvalidCreationFlagsError, n as OperationType, o as predictEntityKey, p as EntityEventName, r as MAX_SALT, s as randomSalt, t as MAX_EXPIRES_AT, u as decodeCreationFlags } from "./index-CLhsFyVH.cjs";
3
- 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";
4
- import { C as QueryOptions, D as ProjectedEntity, E as FullEntity, L as Expression, M as EntityFields, O as SelectArg, S as OwnershipTransferredEvent, T as EntitySelection, _ as EntityDeletedEvent, a as PatchEntityParameters, at as ArkivClient, b as EntityPatchedEvent, c as ExtendEntityReturnType, ct as RpcAttributeSchemaEntry, d as CreateEntityParameters, dt as RpcQueryOptions, f as CreateEntityReturnType, ft as RpcSelect, g as EntityCreatedEvent, h as WatchEntityEventsParameters, i as ExecuteBatchReturnType, it as GetBlockTimingReturnType, j as Entity, l as DeleteEntityParameters, lt as RpcCreationFlags, m as ChangeOwnershipReturnType, n as MimeType, nt as PredictEntityKeysReturnType, o as PatchEntityReturnType, ot as ArkivRpcSchema, p as ChangeOwnershipParameters, r as ExecuteBatchParameters, rt as PredictedEntityKey, s as ExtendEntityParameters, st as RpcAttribute, t as TxParams, tt as PredictEntityKeysParameters, u as DeleteEntityReturnType, ut as RpcEntity, v as EntityEvent, w as QueryReturnType, x as ExpiryExtendedEvent, y as EntityEventContext } from "./index-Dv16LO2s.cjs";
5
- import { n as QueryResult, t as SelectQueryBuilder } from "./index-C7fbakoI.cjs";
6
- import { i as ExpirationTime, n as stringToPayload, r as DeadlineOptions, t as jsonToPayload } from "./payload-D167BlJR.cjs";
1
+ import { a as predictEntityKey, c as ResolvedCreationFlags, d as InvalidCreationFlagsError, f as InvalidExpiryError, i as SaltInput, l as ENTITY_EVENTS_ABI, m as NoRandomSourceError, n as MAX_SALT, o as randomSalt, p as InvalidSaltError, r as NO_SALT, s as CreationFlags, t as MAX_EXPIRES_AT, u as EntityEventName } from "./index-CcVWYB6v.cjs";
2
+ import { n as Lifetime, t as Expiry } from "./expiry-B48I-yTA.cjs";
3
+ import { A as FullRow, At as ArkivClient, B as Selection, C as OwnershipTransferredEvent, Dt as PredictEntityKeysReturnType, E as QueryRow, Et as PredictEntityKeysParameters, F as ResultOf, Ft as RpcEntity, H as SelectionOf, I as Row, It as RpcQueryOptions, J as Entity, L as SYSTEM_FIELDS, Lt as RpcSelect, M as NonEmptySelection, Mt as RpcAttribute, N as PartialRow, Nt as RpcAttributeSchemaEntry, O as DynamicSelection, Ot as PredictedEntityKey, Pt as RpcCreationFlags, R as SelectArg, S as ExpiryExtendedEvent, T as QueryReturnType, U as SystemField, Y as EntityFields, Z as AttributeRef, _ as EntityCreatedEvent, a as ExecuteBatchReturnType, b as EntityEventContext, c as PatchEntityReturnType, d as DeleteEntityParameters, f as DeleteEntityReturnType, g as WatchEntityEventsParameters, h as CreateEntityReturnType, i as ExecuteBatchParameters, j as KnownSystemFields, jt as ArkivRpcSchema, k as FullEntity, kt as GetBlockTimingReturnType, l as ExtendEntityParameters, m as CreateEntityParameters, n as ChangeOwnershipReturnType, nt as Expression, o as PatchEntityChanges, p as CreateEntityOptions, r as TxParams, s as PatchEntityParameters, st as SchemaRef, t as ChangeOwnershipParameters, u as ExtendEntityReturnType, v as EntityDeletedEvent, w as QueryOptions, x as EntityPatchedEvent, y as EntityEvent, z as Selected } from "./changeOwnership-Cy9gfyjN.cjs";
4
+ import { $ as u256, A as describeColumns, B as U64_MAX, C as IndexedColumnName, D as SCHEMA_ATTRIBUTE, E as PatchEntityValues, F as I32_MIN, G as bytes32, H as addr, I as MAX_BYTES_LENGTH, J as decUnits, K as dec, L as MAX_STRING_BYTES, M as lookupColumn, N as BareOf, O as Schema, P as I32_MAX, Q as toValue, R as TagOf, S as CreateEntityValues, T as OptionalColumnName, U as bool, V as ValueInput, W as bytes, X as key, Y as i32, Z as str, _ as Attributes, _t as TypeTag, a as EntityTooLargeError, at as AddrValue, b as Columns, bt as ValueOf, c as MissingValueError, ct as Bytes32Value, d as TooManyAttributesError, dt as I32Value, et as u64, f as UnknownAttributeTypeError, ft as INDEXED_FLAG, g as AttributeSchema, gt as StrValue, h as DECIMAL_UNIT, ht as KeyValue, i as ConflictingMutationError, it as isColumn, j as isSchema, k as defineSchema, l as SchemaDefinitionError, lt as BytesValue, m as DECIMAL_SCALE, mt as IndexableValue, n as isValidAttributeName, nt as Column, o as InvalidAttributeNameError, ot as ArkivValue, p as UntypedValueError, pt as IndexableTypeTag, q as decFromUnits, r as validateAttributeName, rt as ValueArgument, s as InvalidValueError, st as BoolValue, t as MAX_NAME_BYTES, tt as AnyColumn, u as SchemaMismatchError, ut as DecValue, v as MAX_ENTITY_BYTES, vt as U256Value, w as MAX_ATTRIBUTES, x as ColumnsOf, xt as isArkivValue, y as ColumnInput, yt as U64Value, z as U256_MAX } from "./index-C-mMF5WZ.cjs";
5
+ import { d as QueryResult, f as CountQueryBuilder, l as FromOptions, p as QueryBuilderBase, u as SelectQueryBuilder } from "./index-DzriOUm8.cjs";
6
+ import { n as ExpirationTime, t as DeadlineOptions } from "./expirationTime-DOB8V4B8.cjs";
7
7
  import { Account, Address, Chain, Client, Hex, ParseAccount, Prettify, PublicActions, PublicClientConfig, RpcSchema, Transport, WalletActions, WalletClientConfig } from "viem";
8
8
 
9
9
  //#region src/clients/decorators/arkivPublic.d.ts
@@ -12,14 +12,21 @@ type PublicArkivActions<transport extends Transport = Transport, chain extends C
12
12
  /**
13
13
  * Returns the entity with the given key.
14
14
  *
15
- * - JSON-RPC Methods: `arkiv_query`
15
+ * Given a schema, it is read through it: the result is a flat row of every entity field and
16
+ * every column, each typed as the schema declares and checked against it.
17
+ *
18
+ * - JSON-RPC Methods: `arkiv_getEntity`
16
19
  *
17
20
  * @param key - The entity key (hex string)
18
- * @returns The entity with the given key, with every field populated. {@link FullEntity}
21
+ * @param schema - Optionally, the schema to read the entity through.
22
+ * @returns The entity with the given key, with every field populated — a {@link FullEntity}, or
23
+ * a {@link FullRow} through a schema.
19
24
  *
20
25
  * @throws {InvalidValueError} If the key is not 32 bytes.
21
26
  * @throws {NoEntityFoundError} If no live entity has that key — it never existed, or it was
22
27
  * deleted or has expired.
28
+ * @throws {SchemaMismatchError} If, given a schema, the entity does not fit it.
29
+ * @throws {SchemaDefinitionError} If the schema given was not built with `defineSchema`.
23
30
  *
24
31
  * @example
25
32
  * import { createPublicClient } from "@arkiv-network/sdk"
@@ -31,83 +38,115 @@ type PublicArkivActions<transport extends Transport = Transport, chain extends C
31
38
  * transport: http(),
32
39
  * })
33
40
  * const entity = await client.getEntity(entityKey)
34
- * // Entity {
35
- * // key: "0x9f2c…",
36
- * // owner: "0xabc…",
37
- * // contentType: "application/json",
38
- * // payload: Uint8Array, // entity.toJson() / entity.toText() decode it
39
- * // attributes: { category: { type: "str", value: "docs" } },
40
- * // expiresAt: 1_297_000n,
41
+ * // {
42
+ * // $key: "0x9f2c…",
43
+ * // $owner: "0xabc…",
44
+ * // $expiresAt: 1_297_000n,
45
+ * // $attributes: { category: { type: "str", value: "docs" } },
46
+ * // ...
41
47
  * // }
48
+ *
49
+ * const post = await client.getEntity(entityKey, Posts)
50
+ * // { $key: "0x9f2c…", $owner: "0xabc…", ..., category: { type: "str", value: "docs" }, ... }
42
51
  */
43
- getEntity: (key: Hex) => Promise<FullEntity>;
52
+ getEntity: {
53
+ (key: Hex): Promise<FullEntity>;
54
+ <S extends Schema>(key: Hex, schema: S): Promise<FullRow<S>>;
55
+ };
44
56
  /**
45
57
  * Returns a SelectQueryBuilder for building and executing queries — the recommended way to
46
58
  * read entities. You declare up front which parts of an entity you want returned, so results
47
59
  * always contain exactly the data you asked for.
48
60
  *
61
+ * The selection names entity fields and attributes side by side, and each result is a flat row.
62
+ * Chain `.from(schema)` to read through a schema: the selection keeps its meaning, but each
63
+ * attribute comes back typed and checked as the schema declares, and `where` may only filter on
64
+ * the schema's indexed columns.
65
+ *
49
66
  * - JSON-RPC Methods: `arkiv_query`
50
67
  *
51
68
  * @param selection - What to include in the results. Omit it (or pass `"*"`) to select everything,
52
69
  * or pass an object to select specific parts (at least one field is required). Every part is
53
- * opt-in, including the `key`. The selection is flat — each field maps to an entity field.
70
+ * opt-in, including the `$key`. The selection is flat — each field maps to a field of the result.
54
71
  * {@link SelectArg}
55
72
  * @returns A SelectQueryBuilder instance for building and executing queries. {@link SelectQueryBuilder}
56
73
  *
57
74
  * @example
58
75
  * import { createPublicClient } from "@arkiv-network/sdk"
59
76
  * import { tiramisu } from "@arkiv-network/sdk/chains"
60
- * import { eq } from "@arkiv-network/sdk/query"
77
+ * import { and, eq, gt } from "@arkiv-network/sdk/query"
78
+ * import { dec } from "@arkiv-network/sdk/schema"
61
79
  * import { http } from "viem"
62
80
  *
63
81
  * const client = createPublicClient({
64
82
  * chain: tiramisu,
65
83
  * transport: http(),
66
84
  * })
67
- * // select everything
68
- * await client.select().where(eq("category", "docs")).fetch()
69
- * await client.select("*").where(eq("category", "docs")).fetch()
70
- * // only the key
71
- * await client.select({ key: true }).where(eq("category", "docs")).fetch()
72
- * // select specific fields — result typed { owner: Hex; attributes: Attributes }
73
- * await client.select({ owner: true, attributes: true }).fetch()
74
- * // a single field — result typed { owner: Hex }
75
- * await client.select({ owner: true }).fetch()
85
+ * // through a schema — rows typed { $key: Hex; author: AddrValue; title: StrValue }
86
+ * await client
87
+ * .select({ $key: true, author: true, title: true })
88
+ * .from(Posts)
89
+ * .where(and(eq("category", "docs"), gt("score", dec("4.0"))))
90
+ * .fetch()
91
+ * // every field and column
92
+ * await client.select().from(Posts).where(eq("category", "docs")).fetch()
93
+ *
94
+ * // the same selection without a schema — rows typed
95
+ * // { $key: Hex; author: ArkivValue | undefined; title: ArkivValue | undefined }
96
+ * await client.select({ $key: true, author: true, title: true }).where(eq("category", "docs")).fetch()
76
97
  */
77
98
  select: {
78
- /** Select every field. Pass nothing or `"*"`; the returned entities contain all fields. */
79
- (selection?: "*"): SelectQueryBuilder<FullEntity>;
80
99
  /**
81
- * Pick the entity fields to return. Set the ones you want to `true` (at least one is required);
82
- * the result is typed to exactly those fields, so reading anything else is a compile error.
83
- *
84
- * Available fields: `key`, `owner`, `creator`, `createdAt`, `updatedAt`, `expiresAt`,
85
- * `creationFlags`, `contentType`, `payload`, `attributeSchema` and `attributes`.
100
+ * Select every field — and every column through a schema, or the `$attributes` map without
101
+ * one. Pass nothing or `"*"`. The `$attributeSchema` is not included: select it by name.
102
+ */
103
+ (selection?: "*"): SelectQueryBuilder<"*">;
104
+ /**
105
+ * Pick the fields to return. Set the ones you want to `true` (at least one is required); the
106
+ * result is typed to exactly those fields, so reading anything else is a compile error.
86
107
  *
87
- * `attributes` also takes a map of names, to fetch only those:
88
- * `select({ key: true, attributes: { projectId: true } })`.
108
+ * Entity fields start with `$`: `$key`, `$owner`, `$creator`, `$createdAt`, `$updatedAt`,
109
+ * `$expiresAt` and `$creationFlags`. `$attributes` reads every attribute as a map, and
110
+ * `$attributeSchema` their names, types and indexing without the values — a cheap way to find
111
+ * out what entities hold before fetching values that may be too large for one response. Any
112
+ * other name is an attribute, read as a field
113
+ * of its own: untyped without a schema, and through one typed and checked as the column it
114
+ * must be. An attribute name cannot start with `$`, so the two never collide.
89
115
  *
90
116
  * Pass the selection inline so its fields stay literal `true`. A selection stored in a `let`/
91
- * `const` variable widens to `boolean` and the result type can no longer be narrowed — annotate
92
- * it `as const` (e.g. `const sel = { owner: true } as const`) in that case.
117
+ * `const` variable widens to `boolean`, and one typed {@link SelectArg} is only known at
118
+ * runtime: which fields come back is then decided at runtime, so every field of the result is
119
+ * optional — a {@link PartialRow}. Annotate a stored selection `as const` to keep it narrow.
93
120
  *
94
121
  * @example
95
- * client.select({ owner: true, attributes: true }) // entities typed { owner, attributes }
96
- * client.select({ key: true, payload: true }) // includes payload → toText()/toJson() too
97
- * client.select({ key: true, attributeSchema: true }) // what shape is the data?
122
+ * client.select({ $key: true, title: true }) // { $key: Hex; title: ArkivValue | undefined }
123
+ * client.select({ $key: true, title: true }).from(Posts) // { $key: Hex; title: StrValue }
124
+ * client.select({ $owner: true, $attributes: true }) // { $owner: Hex; $attributes: Attributes }
125
+ * client.select({ $key: true, $attributeSchema: true }) // what do they hold? no values
98
126
  */
99
- <const S extends EntitySelection>(selection: S): SelectQueryBuilder<ProjectedEntity<S>>;
100
- /**
101
- * Dynamic selection: accepts a value typed {@link SelectArg} (e.g. built at runtime). The
102
- * result cannot be narrowed in this case, so the entities are typed as the full entity.
103
- */
104
- (selection: SelectArg): SelectQueryBuilder<FullEntity>;
127
+ <const S extends SelectArg>(selection: S & NonEmptySelection<S> & KnownSystemFields<S>): SelectQueryBuilder<SelectionOf<S>>;
105
128
  };
129
+ /**
130
+ * Returns a CountQueryBuilder: counts the entities a query matches, without fetching any of them.
131
+ *
132
+ * It filters exactly as {@link select} does — `.from(schema)`, `.where(...)`, `.ownedBy(...)`,
133
+ * `.createdBy(...)` and `.atBlock(...)` — and `.fetch()` resolves to a `bigint`. To show the total
134
+ * next to a page of rows, use `select(...).withCount()` instead.
135
+ *
136
+ * - JSON-RPC Methods: `arkiv_query`, with the `count` projection
137
+ *
138
+ * @example
139
+ * const total = await client.count().from(Posts).ownedBy(account.address).fetch()
140
+ * const news = await client.count().from(Posts).where(eq("category", "news")).fetch()
141
+ */
142
+ count: () => CountQueryBuilder;
106
143
  /**
107
144
  * Runs one query and returns one page, with no builder in between.
108
145
  *
109
- * Use {@link PublicArkivActions.select} for anything typed — this returns full {@link Entity} objects whatever the
110
- * selection, and takes a raw string as an escape hatch for a query built elsewhere. A raw string
146
+ * The selection means what it does in {@link PublicArkivActions.select}, and the results are the
147
+ * same flat rows a query without a schema returns, typed from the selection. Use `select()` to
148
+ * read through a schema. This also takes a raw string as an escape hatch for a query built
149
+ * elsewhere. A raw string
111
150
  * goes to the node exactly as written, with none of the name, type or operator checks the
112
151
  * expression combinators apply.
113
152
  *
@@ -119,7 +158,7 @@ type PublicArkivActions<transport extends Transport = Transport, chain extends C
119
158
  * import { createPublicClient } from "@arkiv-network/sdk"
120
159
  * import { tiramisu } from "@arkiv-network/sdk/chains"
121
160
  * import { and, eq, gte } from "@arkiv-network/sdk/query"
122
- * import { i32 } from "@arkiv-network/sdk/attr"
161
+ * import { i32 } from "@arkiv-network/sdk/schema"
123
162
  * import { http } from "viem"
124
163
  *
125
164
  * const client = createPublicClient({
@@ -127,32 +166,15 @@ type PublicArkivActions<transport extends Transport = Transport, chain extends C
127
166
  * transport: http(),
128
167
  * })
129
168
  * const page = await client.query(and(eq("category", "docs"), gte("level", i32(10))), {
130
- * select: { key: true, attributes: true },
169
+ * select: { $key: true, title: true },
131
170
  * limit: 100,
132
171
  * })
133
- * // { entities: [Entity], cursor: "b64:…", blockNumber: 32223n }
172
+ * // { entities: [{ $key: Hex; title: ArkivValue | undefined }], cursor: "b64:…", blockNumber: 32223n }
134
173
  *
135
174
  * // The raw form, unchecked:
136
175
  * await client.query("category = str('docs') AND level >= i32(10)")
137
176
  */
138
- query: (query: Expression | string, queryOptions?: QueryOptions) => Promise<QueryReturnType>;
139
- /**
140
- * Returns the total number of entities on the chain.
141
- * @returns The number of entities currently stored
142
- *
143
- * @example
144
- * import { createPublicClient } from "@arkiv-network/sdk"
145
- * import { tiramisu } from "@arkiv-network/sdk/chains"
146
- * import { http } from "viem"
147
- *
148
- * const client = createPublicClient({
149
- * chain: tiramisu,
150
- * transport: http(),
151
- * })
152
- * const entityCount = await client.getEntityCount()
153
- * // entityCount = 0
154
- */
155
- getEntityCount: () => Promise<number>;
177
+ query: <const S extends SelectArg = "*">(query: Expression | string, queryOptions?: QueryOptions<S>) => Promise<QueryReturnType<QueryRow<S>>>;
156
178
  /**
157
179
  * Returns how many entities an account has created — its entity-minting nonce.
158
180
  *
@@ -194,18 +216,19 @@ type PublicArkivActions<transport extends Transport = Transport, chain extends C
194
216
  * {@link PredictEntityKeysReturnType}
195
217
  *
196
218
  * @example A batch whose second entity points at its first.
197
- * import { key } from "@arkiv-network/sdk/attr"
219
+ * import { defineSchema, key, str } from "@arkiv-network/sdk/schema"
220
+ *
221
+ * const Nodes = defineSchema("nodes", { name: str(), parent: key().indexed().optional() })
198
222
  *
199
223
  * const [parent, child] = await client.predictEntityKeys({ owner: account.address, count: 2 })
200
224
  * await wallet.executeBatch({
201
225
  * creates: [
202
- * { payload, contentType, expires, salt: parent.salt },
226
+ * { schema: Nodes, values: { name: "root" }, expiration, salt: parent.salt },
203
227
  * {
204
- * payload,
205
- * contentType,
206
- * expires,
228
+ * schema: Nodes,
229
+ * values: { name: "leaf", parent: key(parent.key) },
230
+ * expiration,
207
231
  * salt: child.salt,
208
- * attributes: { parent: key(parent.key) },
209
232
  * },
210
233
  * ],
211
234
  * })
@@ -288,76 +311,90 @@ declare function createPublicClient<transport extends Transport, chain extends C
288
311
  //#region src/clients/decorators/arkivWallet.d.ts
289
312
  type WalletArkivActions<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = Pick<PublicActions<transport, chain, account>, "waitForTransactionReceipt" | "call" | "simulateContract" | "readContract" | "getBlockNumber"> & Pick<WalletActions<chain, account>, "addChain" | "sendCalls" | "waitForCallsStatus" | "sendTransaction" | "sendRawTransaction" | "signMessage" | "signTransaction" | "writeContract"> & {
290
313
  /**
291
- * Creates a new entity.
314
+ * Creates a new entity through a schema: each column becomes an attribute, written with the
315
+ * type and indexed flag the schema declares.
292
316
  *
293
317
  * - JSON-RPC Methods: `eth_sendRawTransaction`
294
318
  *
295
- * @param data - The entity creation parameters
319
+ * @param schema - The schema the entity is written through, built with `defineSchema`.
320
+ * @param values - The entity's values, keyed by column. Required columns must be given;
321
+ * defaulted ones left out are written with their default. {@link CreateEntityValues}
322
+ * @param options - The entity's lifetime, plus its flags and salt. {@link CreateEntityOptions}
296
323
  * @param txParams - Optional transaction parameters
297
- * @returns The new entity's key, the transaction hash, and the block it is expected to
298
- * expire at. {@link CreateEntityReturnType}
324
+ * @returns The new entity's key, the transaction hash, and the block it expires at, as the
325
+ * engine recorded it. {@link CreateEntityReturnType}
299
326
  *
300
327
  * @throws {InvalidExpiryError} If the expiry exceeds a protocol bound or would leave the
301
328
  * entity dead on arrival.
302
- * @throws {InvalidValueError} If an attribute value does not fit the type it names.
303
- * @throws {InvalidAttributeNameError} If a name violates the attribute-name grammar.
329
+ * @throws {SchemaMismatchError} If the values do not fit the schema.
330
+ * @throws {InvalidValueError} If a value does not fit its type.
331
+ * @throws {EntityTooLargeError} If the `bytes` values add up to more than `MAX_ENTITY_BYTES`.
332
+ * @throws {EntityMutationError} If the transaction fails or reverts.
304
333
  *
305
334
  * @example
306
- * import { createWalletClient, ExpirationTime, jsonToPayload } from "@arkiv-network/sdk"
307
- * import { i32 } from "@arkiv-network/sdk/attr"
335
+ * import { createWalletClient, ExpirationTime } from "@arkiv-network/sdk"
336
+ * import { addr, bytes, dec, defineSchema, str } from "@arkiv-network/sdk/schema"
308
337
  * import { tiramisu } from "@arkiv-network/sdk/chains"
309
338
  * import { http } from "viem"
310
339
  * import { privateKeyToAccount } from "viem/accounts"
311
340
  *
341
+ * const Posts = defineSchema("posts", {
342
+ * author: addr().indexed(),
343
+ * category: str().indexed(),
344
+ * score: dec().indexed(),
345
+ * title: str(),
346
+ * body: bytes(),
347
+ * thumbnail: bytes().optional(),
348
+ * mimeType: str().default("text/markdown"),
349
+ * })
350
+ *
312
351
  * const client = createWalletClient({
313
352
  * account: privateKeyToAccount("0x..."),
314
353
  * chain: tiramisu,
315
354
  * transport: http(),
316
355
  * })
317
- * const { entityKey, txHash, expiresAt } = await client.createEntity({
318
- * payload: jsonToPayload({ entityType: "testType", entityId: "testId" }),
319
- * contentType: "application/json",
320
- * attributes: { testKey: "testValue", level: i32(3) },
321
- * expires: ExpirationTime.fromDays(30),
322
- * })
356
+ * const { entityKey, txHash, expiresAt } = await client.createEntity(
357
+ * Posts,
358
+ * {
359
+ * author: addr(client.account.address),
360
+ * category: "docs",
361
+ * score: dec("4.1"),
362
+ * title: "Cells, not entities",
363
+ * body: new TextEncoder().encode("# Hello"),
364
+ * },
365
+ * { expiration: ExpirationTime.fromDays(30) },
366
+ * )
323
367
  */
324
- createEntity: (data: CreateEntityParameters, txParams?: TxParams) => Promise<CreateEntityReturnType>;
368
+ createEntity: <S extends Schema>(schema: S, values: CreateEntityValues<S>, options: CreateEntityOptions, txParams?: TxParams) => Promise<CreateEntityReturnType>;
325
369
  /**
326
- * Applies a patch to the entity with the given key: sets some fields, unsets others, and leaves
327
- * everything it does not name alone.
370
+ * Patches the entity with the given key through a schema: sets some columns, unsets optional
371
+ * ones, and leaves everything it does not name alone.
328
372
  *
329
373
  * - JSON-RPC Methods: `eth_sendRawTransaction`
330
374
  *
331
- * @param data - The entity key and the mutations to apply
375
+ * @param schema - The schema the changes are typed by.
376
+ * @param entityKey - The entity to patch.
377
+ * @param changes - The columns to set and the optional columns to unset. {@link PatchEntityChanges}
332
378
  * @param txParams - Optional transaction parameters
333
379
  * @returns The patched entity's key and the transaction hash. {@link PatchEntityReturnType}
334
380
  *
335
381
  * @throws {EmptyPatchError} If the patch has nothing to apply.
336
382
  * @throws {ConflictingMutationError} If a name appears in both `set` and `unset`.
337
- * @throws {InvalidValueError} If an attribute value does not fit the type it names.
338
- * @throws {InvalidAttributeNameError} If a name violates the attribute-name grammar.
383
+ * @throws {SchemaMismatchError} If the changes do not fit the schema.
384
+ * @throws {InvalidValueError} If a value does not fit its type.
385
+ * @throws {EntityTooLargeError} If the `bytes` values in `set` add up to more than
386
+ * `MAX_ENTITY_BYTES`.
387
+ * @throws {EntityMutationError} If the transaction fails or reverts.
339
388
  *
340
389
  * @example
341
- * import { createWalletClient, jsonToPayload } from "@arkiv-network/sdk"
342
- * import { i32 } from "@arkiv-network/sdk/attr"
343
- * import { tiramisu } from "@arkiv-network/sdk/chains"
344
- * import { http } from "viem"
345
- * import { privateKeyToAccount } from "viem/accounts"
346
- *
347
- * const client = createWalletClient({
348
- * account: privateKeyToAccount("0x..."),
349
- * chain: tiramisu,
350
- * transport: http(),
351
- * })
352
- * // Publish the entity: one attribute changes, one goes away, the payload is replaced.
353
- * const { txHash } = await client.patchEntity({
354
- * entityKey,
355
- * set: { status: "published", revision: i32(2) },
356
- * unset: ["draft"],
357
- * payload: jsonToPayload({ title: "Hello" }),
390
+ * // Posts is the schema from the createEntity example.
391
+ * // One column changes, an optional one goes away.
392
+ * const { txHash } = await client.patchEntity(Posts, entityKey, {
393
+ * set: { score: dec("4.5") },
394
+ * unset: ["thumbnail"],
358
395
  * })
359
396
  */
360
- patchEntity: (data: PatchEntityParameters, txParams?: TxParams) => Promise<PatchEntityReturnType>;
397
+ patchEntity: <S extends Schema>(schema: S, entityKey: Hex, changes: PatchEntityChanges<S>, txParams?: TxParams) => Promise<PatchEntityReturnType>;
361
398
  /**
362
399
  * Deletes the entity with the given key.
363
400
  *
@@ -387,14 +424,15 @@ type WalletArkivActions<transport extends Transport = Transport, chain extends C
387
424
  *
388
425
  * The new lifetime is resolved the same way a create's is: a duration counts from now rather
389
426
  * than adding to what the entity has left, and `atBlock` / `atDate` pin an absolute deadline.
390
- * The engine rejects an extension that would not move the expiry later.
427
+ * The engine rejects an extension that would move the expiry earlier; one that resolves to the
428
+ * current expiry changes nothing.
391
429
  *
392
430
  * - JSON-RPC Methods: `eth_sendRawTransaction`
393
431
  *
394
432
  * @param data - The entity key and its new lifetime
395
433
  * @param txParams - Optional transaction parameters
396
- * @returns The entity's key, the transaction hash, and the block it is now expected to expire
397
- * at. {@link ExtendEntityReturnType}
434
+ * @returns The entity's key, the transaction hash, and the block it now expires at, as the
435
+ * engine recorded it. {@link ExtendEntityReturnType}
398
436
  *
399
437
  * @throws {InvalidExpiryError} If the expiry is malformed, exceeds a protocol bound, or would
400
438
  * leave the entity dead on arrival.
@@ -412,7 +450,7 @@ type WalletArkivActions<transport extends Transport = Transport, chain extends C
412
450
  * })
413
451
  * const { txHash, expiresAt } = await client.extendEntity({
414
452
  * entityKey,
415
- * expires: ExpirationTime.fromDays(30),
453
+ * expiration: ExpirationTime.fromDays(30),
416
454
  * })
417
455
  */
418
456
  extendEntity: (data: ExtendEntityParameters, txParams?: TxParams) => Promise<ExtendEntityReturnType>;
@@ -433,19 +471,28 @@ type WalletArkivActions<transport extends Transport = Transport, chain extends C
433
471
  * - JSON-RPC Methods: `eth_sendRawTransaction`
434
472
  *
435
473
  * Every operation lands in one transaction, so the whole batch applies or none of it does.
436
- * At least one operation is required.
474
+ * At least one operation is required. Each create and patch names its own schema and is typed
475
+ * by it, so one batch can write entities of several schemas.
437
476
  *
438
477
  * @param data - The batch parameters (creates, patches, deletes, extensions, ownershipChanges)
439
478
  * @param txParams - Optional transaction parameters
440
479
  * @returns The transaction hash, plus the keys touched by each kind of operation.
441
480
  * {@link ExecuteBatchReturnType}
442
481
  *
482
+ * @throws {Error} If the batch has no operations.
443
483
  * @throws {InvalidExpiryError} If an expiry exceeds a protocol bound or would leave the entity
444
484
  * dead on arrival.
445
- * @throws {InvalidValueError} If an attribute value does not fit the type it names.
485
+ * @throws {SchemaMismatchError} If a create's or patch's values do not fit its schema.
486
+ * @throws {InvalidValueError} If a value does not fit its type.
487
+ * @throws {EmptyPatchError} If a patch has nothing to apply.
488
+ * @throws {ConflictingMutationError} If a patch names a column in both `set` and `unset`.
489
+ * @throws {EntityTooLargeError} If the `bytes` values of one create or patch add up to more
490
+ * than `MAX_ENTITY_BYTES`.
491
+ * @throws {EntityMutationError} If the transaction fails or reverts.
446
492
  *
447
493
  * @example
448
- * import { createWalletClient, ExpirationTime, jsonToPayload } from "@arkiv-network/sdk"
494
+ * import { createWalletClient, ExpirationTime } from "@arkiv-network/sdk"
495
+ * import { dec } from "@arkiv-network/sdk/schema"
449
496
  * import { tiramisu } from "@arkiv-network/sdk/chains"
450
497
  * import { http } from "viem"
451
498
  * import { privateKeyToAccount } from "viem/accounts"
@@ -455,23 +502,23 @@ type WalletArkivActions<transport extends Transport = Transport, chain extends C
455
502
  * chain: tiramisu,
456
503
  * transport: http(),
457
504
  * })
505
+ * // Posts is the schema from the createEntity example.
458
506
  * const { txHash, createdEntities } = await client.executeBatch({
459
507
  * creates: [{
460
- * payload: jsonToPayload({ entityType: "testType", entityId: "testId" }),
461
- * contentType: "application/json",
462
- * attributes: { testKey: "testValue" },
463
- * expires: ExpirationTime.fromDays(30),
508
+ * schema: Posts,
509
+ * values: { author, category: "docs", score: dec("4.1"), title: "Hi", body: new Uint8Array() },
510
+ * expiration: ExpirationTime.fromDays(30),
464
511
  * }],
465
- * patches: [{ entityKey: keyToRevise, set: { status: "archived" }, unset: ["draft"] }],
512
+ * patches: [{ schema: Posts, entityKey: keyToRevise, set: { category: "archive" } }],
466
513
  * deletes: [{ entityKey: staleKey }],
467
514
  * extensions: [{
468
515
  * entityKey: keyToKeepAlive,
469
- * expires: ExpirationTime.atBlock(1_200_000n),
516
+ * expiration: ExpirationTime.atBlock(1_200_000n),
470
517
  * }],
471
518
  * ownershipChanges: [{ entityKey: keyToHandOver, newOwner }],
472
519
  * })
473
520
  */
474
- executeBatch: (data: ExecuteBatchParameters, txParams?: TxParams) => Promise<ExecuteBatchReturnType>;
521
+ executeBatch: <const TCreates extends readonly Schema[] = [], const TPatches extends readonly Schema[] = []>(data: ExecuteBatchParameters<TCreates, TPatches>, txParams?: TxParams) => Promise<ExecuteBatchReturnType>;
475
522
  };
476
523
  //#endregion
477
524
  //#region src/clients/createWalletClient.d.ts
@@ -482,7 +529,10 @@ type WalletArkivClient<transport extends Transport = Transport, chain extends Ch
482
529
  *
483
530
  * A Wallet Client signs and sends transactions, so it carries an `account` and exposes everything
484
531
  * that mutates state — `createEntity`, `patchEntity`, `deleteEntity`, `extendEntity`,
485
- * `changeOwnership` and `executeBatch` — on top of the read actions a Public Client has.
532
+ * `changeOwnership` and `executeBatch` — alongside the viem actions those need, such as
533
+ * `getBlockNumber`, `readContract` and `waitForTransactionReceipt`. It does not have the Arkiv
534
+ * read actions (`getEntity`, `query`, `select`, `watchEntityEvents`, `predictEntityKeys`); read
535
+ * through a Public Client from `createPublicClient` for those.
486
536
  *
487
537
  * @param parameters - Configuration object for the wallet client (chain, transport, account, etc.)
488
538
  * @returns An Arkiv Wallet Client. {@link WalletArkivClient}
@@ -521,9 +571,6 @@ declare class EmptyPatchError extends Error {
521
571
  readonly entityKey: string;
522
572
  constructor(entityKey: string);
523
573
  }
524
- declare class InvalidContentTypeError extends Error {
525
- constructor(contentType: string);
526
- }
527
574
  //#endregion
528
575
  //#region src/utils/chains.d.ts
529
576
  /**
@@ -534,5 +581,5 @@ declare class InvalidContentTypeError extends Error {
534
581
  */
535
582
  declare function chainFromName(name: string): Chain;
536
583
  //#endregion
537
- export { AddrValue, AnyArkivValue, type ArkivClient, ArkivRpcSchema, ArkivValue, AttributeInputs, AttributeSchema, Attributes, BoolValue, Bytes32Value, BytesValue, ChangeOwnershipParameters, ChangeOwnershipReturnType, ConflictingMutationError, CreateEntityParameters, CreateEntityReturnType, CreationFlags, DECIMAL_SCALE, DECIMAL_UNIT, type DeadlineOptions, DecValue, DeleteEntityParameters, DeleteEntityReturnType, ENTITY_EVENTS_ABI, EmptyPatchError, EncodedExpiry, Entity, EntityCreatedEvent, EntityDeletedEvent, EntityEvent, EntityEventContext, EntityEventName, EntityFields, EntityMutationError, EntityPatchedEvent, type EntitySelection, ExecuteBatchParameters, ExecuteBatchReturnType, ExpirationTime, Expiry, ExpiryContext, ExpiryExtendedEvent, type Expression, ExtendEntityParameters, ExtendEntityReturnType, type FullEntity, GetBlockTimingReturnType, I32Value, I32_MAX, I32_MIN, InvalidAttributeNameError, InvalidContentTypeError, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, InvalidValueError, KeyValue, Lifetime, MAX_ATTRIBUTES, MAX_EXPIRES_AT, MAX_NAME_BYTES, MAX_PAYLOAD_BYTES, MAX_SALT, MAX_STRING_BYTES, MimeType, MissingValueError, NO_SALT, NoEntityFoundError, NoMoreResultsError, NoRandomSourceError, OperationType, OwnershipTransferredEvent, PatchEntityParameters, PatchEntityReturnType, PredictEntityKeysParameters, PredictEntityKeysReturnType, PredictedEntityKey, type ProjectedEntity, type PublicArkivActions, type PublicArkivClient, QueryOptions, type QueryResult, QueryReturnType, ResolvedCreationFlags, ResolvedExpiry, RpcAttribute, RpcAttributeSchemaEntry, RpcCreationFlags, RpcEntity, RpcQueryOptions, RpcSelect, SaltInput, type SelectArg, SelectQueryBuilder, StrValue, TooManyAttributesError, TxParams, TypeTag, U256Value, U256_MAX, U64Value, U64_MAX, UnknownAttributeTypeError, UntypedValueError, UserTypeTag, ValueInput, type WalletArkivActions, type WalletArkivClient, WatchEntityEventsParameters, addr, bool, bytes32, chainFromName, createPublicClient, createWalletClient, dec, decFromUnits, decUnits, decodeCreationFlags, encodeCreationFlags, i32, isArkivValue, isValidAttributeName, jsonToPayload, key, predictEntityKey, randomSalt, resolveExpiry, str, stringToPayload, toBlocks, toValue, u256, u64, validateAttributeName };
584
+ export { AddrValue, AnyColumn, type ArkivClient, ArkivRpcSchema, ArkivValue, type AttributeRef, AttributeSchema, Attributes, BareOf, BoolValue, Bytes32Value, BytesValue, ChangeOwnershipParameters, ChangeOwnershipReturnType, Column, ColumnInput, Columns, ColumnsOf, ConflictingMutationError, CountQueryBuilder, CreateEntityOptions, CreateEntityParameters, CreateEntityReturnType, CreateEntityValues, CreationFlags, DECIMAL_SCALE, DECIMAL_UNIT, type DeadlineOptions, DecValue, DeleteEntityParameters, DeleteEntityReturnType, type DynamicSelection, ENTITY_EVENTS_ABI, EmptyPatchError, Entity, EntityCreatedEvent, EntityDeletedEvent, EntityEvent, EntityEventContext, EntityEventName, EntityFields, EntityMutationError, EntityPatchedEvent, EntityTooLargeError, ExecuteBatchParameters, ExecuteBatchReturnType, ExpirationTime, Expiry, ExpiryExtendedEvent, type Expression, ExtendEntityParameters, ExtendEntityReturnType, type FromOptions, type FullEntity, type FullRow, GetBlockTimingReturnType, I32Value, I32_MAX, I32_MIN, INDEXED_FLAG, IndexableTypeTag, IndexableValue, IndexedColumnName, InvalidAttributeNameError, InvalidCreationFlagsError, InvalidExpiryError, InvalidSaltError, InvalidValueError, KeyValue, type KnownSystemFields, Lifetime, MAX_ATTRIBUTES, MAX_BYTES_LENGTH, MAX_ENTITY_BYTES, MAX_EXPIRES_AT, MAX_NAME_BYTES, MAX_SALT, MAX_STRING_BYTES, MissingValueError, NO_SALT, NoEntityFoundError, NoMoreResultsError, NoRandomSourceError, type NonEmptySelection, OptionalColumnName, OwnershipTransferredEvent, type PartialRow, PatchEntityChanges, PatchEntityParameters, PatchEntityReturnType, PatchEntityValues, PredictEntityKeysParameters, PredictEntityKeysReturnType, PredictedEntityKey, type PublicArkivActions, type PublicArkivClient, type QueryBuilderBase, QueryOptions, type QueryResult, QueryReturnType, QueryRow, ResolvedCreationFlags, type ResultOf, type Row, RpcAttribute, RpcAttributeSchemaEntry, RpcCreationFlags, RpcEntity, RpcQueryOptions, RpcSelect, SCHEMA_ATTRIBUTE, SYSTEM_FIELDS, SaltInput, Schema, SchemaDefinitionError, SchemaMismatchError, type SchemaRef, type SelectArg, SelectQueryBuilder, type Selected, type Selection, type SelectionOf, StrValue, type SystemField, TagOf, TooManyAttributesError, TxParams, TypeTag, U256Value, U256_MAX, U64Value, U64_MAX, UnknownAttributeTypeError, UntypedValueError, ValueArgument, ValueInput, ValueOf, type WalletArkivActions, type WalletArkivClient, WatchEntityEventsParameters, addr, bool, bytes, bytes32, chainFromName, createPublicClient, createWalletClient, dec, decFromUnits, decUnits, defineSchema, describeColumns, i32, isArkivValue, isColumn, isSchema, isValidAttributeName, key, lookupColumn, predictEntityKey, randomSalt, str, toValue, u256, u64, validateAttributeName };
538
585
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/clients/decorators/arkivWallet.ts","../src/clients/createWalletClient.ts","../src/errors.ts","../src/utils/chains.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAsBoB,KADR,kBACQ,CAAA,kBAAA,SAAA,GAAY,SAAZ,EAAA,cACJ,KADI,GAAA,SAAA,GACgB,KADhB,GAAA,SAAA,EAAA,gBAEF,OAFE,GAAA,SAAA,GAEoB,OAFpB,GAAA,SAAA,CAAA,GAGhB,IAHgB,CAIlB,aAJkB,CAIJ,SAJI,EAIO,KAJP,EAIc,OAJd,CAAA,EAAA,YAAA,GAAA,UAAA,GAAA,gBAAA,GAAA,YAAA,GAAA,SAAA,GAAA,gBAAA,GAAA,qBAAA,GAAA,uBAAA,GAAA,2BAAA,GAAA,YAAA,CAAA,GAAA;EAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkOY,SAAA,EAAA,CAAA,GAAA,EAnLzB,GAmLyB,EAAA,GAnLjB,OAmLiB,CAnLT,UAmLS,CAAA;EAAQ;;;;;;;;;;;;;ACzOpD;;;;;;;;;;;;;;;;;;AA6BA;;EAEgB,MAAA,EAAA;IACW;IAAU,CAAA,SAAA,CAAA,EAAA,GAAA,CAAA,ED2Dd,kBC3Dc,CD2DK,UC3DL,CAAA;IACjB;;;;;;;;;;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;;;;;;;;;;;;;;;AAyGiD,iBG/EjC,kBH+EiC,CAAA,kBG9E7B,SH8E6B,EAAA,cG7EjC,KH6EiC,GAAA,SAAA,GAAA,SAAA,EAAA,yBG5EtB,OH4EsB,GG5EZ,OH4EY,GAAA,SAAA,GAAA,SAAA,EAAA,kBG3E7B,SH2E6B,GAAA,SAAA,GG3EL,cH2EK,CAAA,CAAA,UAAA,EGzEnC,kBHyEmC,CGzEhB,SHyEgB,EGzEL,KHyEK,EGzEE,gBHyEF,EGzEoB,SHyEpB,CAAA,CAAA,EGxE9C,iBHwE8C,CGxE5B,SHwE4B,EGxEjB,KHwEiB,EGxEV,YHwEU,CGxEG,gBHwEH,CAAA,EGxEsB,SHwEtB,CAAA;;;cI5HpC,mBAAA,SAA4B,KAAA;mBACtB;;;aAEkD;;;cAMxD,kBAAA,SAA2B,KAAA;EJU5B,WAAA,CAAA;;AACoB,cIJnB,kBAAA,SAA2B,KAAA,CJIR;EAChB;EAAoB,SAAA,SAAA,EAAA,MAAA,GAAA,SAAA;EAClB,WAAA,CAAA,SAAA,CAAA,EAAA,MAAA;;AAEF,cIQH,eAAA,SAAwB,KAAA,CJRrB;EAAW,SAAA,SAAA,EAAA,MAAA;EAAO,WAAA,CAAA,SAAA,EAAA,MAAA;;AAD9B,cIsBS,uBAAA,SAAgC,KAAA,CJtBzC;EA4Ce,WAAA,CAAA,WAAA,EAAA,MAAA;;;;;;;;;;iBKzDH,aAAA,gBAA6B"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/clients/decorators/arkivPublic.ts","../src/clients/createPublicClient.ts","../src/clients/decorators/arkivWallet.ts","../src/clients/createWalletClient.ts","../src/errors.ts","../src/utils/chains.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAmCgC,KADpB,kBACoB,CAAA,kBAAZ,SAAY,GAAA,SAAA,EAAA,cAChB,KADgB,GAAA,SAAA,GACI,KADJ,GAAA,SAAA,EAAA,gBAEd,OAFc,GAAA,SAAA,GAEQ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