@arkiv-network/sdk 0.8.0-advanced.2 → 0.8.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -42
- package/dist/attr/index.cjs +33 -34
- package/dist/attr/index.d.cts +1 -1
- package/dist/attr/index.d.ts +1 -2
- package/dist/attr/index.js +1 -2
- package/dist/{attributes-Df9IsCVs.cjs → attr-BXTkpnoc.cjs} +13 -3
- package/dist/{attributes-BhY5DwJp.js → attr-tmyREHtw.js} +14 -4
- package/dist/attr-tmyREHtw.js.map +1 -0
- package/dist/chains/index.cjs +1 -1
- package/dist/chains/index.d.cts +3 -0
- package/dist/chains/index.d.cts.map +1 -1
- package/dist/chains/index.d.ts +3 -0
- package/dist/chains/index.d.ts.map +1 -1
- package/dist/chains/index.js +1 -1
- package/dist/{chains-BYRTTipa.cjs → chains-BfNQliHU.cjs} +3 -0
- package/dist/{chains-BJrZs6sG.js → chains-Du8tql7I.js} +4 -1
- package/dist/chains-Du8tql7I.js.map +1 -0
- package/dist/{arkivTransactions-NtGD6uk5.d.ts → changeOwnership-B0ar96ub.d.ts} +74 -123
- package/dist/changeOwnership-B0ar96ub.d.ts.map +1 -0
- package/dist/{arkivTransactions-D74gERHG.d.cts → changeOwnership-BofkLnXJ.d.cts} +74 -123
- package/dist/changeOwnership-BofkLnXJ.d.cts.map +1 -0
- package/dist/entity/index.cjs +9 -9
- package/dist/entity/index.d.cts +3 -3
- package/dist/entity/index.d.ts +4 -5
- package/dist/entity/index.js +5 -6
- package/dist/{entity-BYQR1uoe.js → entity-BIp_df9u.js} +1 -1
- package/dist/{entity-BYQR1uoe.js.map → entity-BIp_df9u.js.map} +1 -1
- package/dist/{key-D1Bh7MF0.js → entity-CniBgBSd.js} +31 -19
- package/dist/entity-CniBgBSd.js.map +1 -0
- package/dist/{key-WKhXnXuU.cjs → entity-DJ0Gml9c.cjs} +37 -19
- package/dist/{errors-LTe7bOYS.js → errors-D2E1GRjw.js} +2 -2
- package/dist/errors-D2E1GRjw.js.map +1 -0
- package/dist/{errors-BVbjKVMN.cjs → errors-DhV00966.cjs} +1 -1
- package/dist/{expiry-nDbCgZX4.d.ts → expiry-BxOlvVWC.d.ts} +1 -1
- package/dist/{expiry-nDbCgZX4.d.ts.map → expiry-BxOlvVWC.d.ts.map} +1 -1
- package/dist/{expiry-BELY2Kpw.cjs → expiry-CG9GhVXv.cjs} +1 -1
- package/dist/{expiry-BjpxZZQU.js → expiry-Cgdb_dbq.js} +2 -2
- package/dist/expiry-Cgdb_dbq.js.map +1 -0
- package/dist/expiry-DRV29F1r.d.cts.map +1 -1
- package/dist/{flags-CRjPpoh3.d.cts → flags-0Vl5rrHq.d.cts} +1 -1
- package/dist/{flags-CRjPpoh3.d.cts.map → flags-0Vl5rrHq.d.cts.map} +1 -1
- package/dist/{flags-kr276q6i.cjs → flags-DCD26uhe.cjs} +1 -1
- package/dist/{flags-DFBs2J94.js → flags-DUT2gHEU.js} +2 -2
- package/dist/{flags-DFBs2J94.js.map → flags-DUT2gHEU.js.map} +1 -1
- package/dist/{flags-5dTNRnow.d.ts → flags-wmcMoAnN.d.ts} +1 -1
- package/dist/{flags-5dTNRnow.d.ts.map → flags-wmcMoAnN.d.ts.map} +1 -1
- package/dist/{index-fX_XyqLp.d.ts → index-BGp2plHs.d.cts} +15 -13
- package/dist/index-BGp2plHs.d.cts.map +1 -0
- package/dist/{index-DHDud2hC.d.ts → index-BKB875Um.d.ts} +5 -7
- package/dist/{index-DHDud2hC.d.ts.map → index-BKB875Um.d.ts.map} +1 -1
- package/dist/{index-DvYvrkdk.d.ts → index-CIcHPx2j.d.cts} +110 -6
- package/dist/index-CIcHPx2j.d.cts.map +1 -0
- package/dist/{index-CV5zCdpa.d.cts → index-Cd2aaWme.d.ts} +13 -6
- package/dist/index-Cd2aaWme.d.ts.map +1 -0
- package/dist/{index-CA4V7Pdh.d.cts → index-ezMZ2-JH.d.ts} +15 -13
- package/dist/index-ezMZ2-JH.d.ts.map +1 -0
- package/dist/{index-BF7Mq9Is.d.cts → index-rINthNuU.d.cts} +5 -7
- package/dist/{index-BF7Mq9Is.d.cts.map → index-rINthNuU.d.cts.map} +1 -1
- package/dist/index.cjs +433 -139
- package/dist/index.d.cts +58 -164
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +59 -166
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +376 -75
- package/dist/index.js.map +1 -1
- package/dist/{payload-CcUj85ys.d.ts → payload-CGvVPZQX.d.ts} +61 -2
- package/dist/payload-CGvVPZQX.d.ts.map +1 -0
- package/dist/{payload-Bz6651ax.js → payload-DE7wMztL.js} +28 -3
- package/dist/payload-DE7wMztL.js.map +1 -0
- package/dist/{payload-BNoud2KZ.d.cts → payload-Dfu30njp.d.cts} +60 -1
- package/dist/payload-Dfu30njp.d.cts.map +1 -0
- package/dist/{payload-KC14SDlN.cjs → payload-DqFweqiO.cjs} +27 -2
- package/dist/query/index.cjs +5 -7
- package/dist/query/index.d.cts +4 -4
- package/dist/query/index.d.ts +4 -5
- package/dist/query/index.js +5 -7
- package/dist/{queryBuilder-DM6AWCBa.js → queryBuilder-wvA8sn--.js} +169 -23
- package/dist/queryBuilder-wvA8sn--.js.map +1 -0
- package/dist/{queryBuilder-DbUMEZln.cjs → queryBuilder-zHGhDmaG.cjs} +215 -33
- package/dist/{selection-DPg0uyJf.d.cts → selection-Bv8_o-7i.d.cts} +76 -68
- package/dist/selection-Bv8_o-7i.d.cts.map +1 -0
- package/dist/{selection-C4UhsMOO.d.ts → selection-ox7zdtVm.d.ts} +76 -69
- package/dist/selection-ox7zdtVm.d.ts.map +1 -0
- package/dist/types/index.cjs +2 -2
- package/dist/types/index.d.cts +6 -6
- package/dist/types/index.d.ts +7 -8
- package/dist/types/index.js +2 -2
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.js +3 -3
- package/package.json +1 -5
- package/src/actions/public/getEntity.ts +1 -0
- package/src/actions/public/predictEntityKeys.test.ts +17 -1
- package/src/actions/public/predictEntityKeys.ts +28 -14
- package/src/actions/public/query.ts +1 -5
- package/src/actions/wallet/createEntity.ts +7 -6
- package/src/actions/wallet/{mutateEntities.test.ts → executeBatch.test.ts} +7 -7
- package/src/actions/wallet/{mutateEntities.ts → executeBatch.ts} +26 -11
- package/src/actions/wallet/extendEntity.ts +1 -0
- package/src/actions/wallet/patchEntity.ts +3 -3
- package/src/attr/attributes.ts +8 -2
- package/src/attr/errors.ts +2 -2
- package/src/attr/types.ts +3 -3
- package/src/attr/values.ts +5 -1
- package/src/chains/localhost.ts +3 -0
- package/src/clients/createPublicClient.test.ts +1 -1
- package/src/clients/createPublicClient.ts +5 -5
- package/src/clients/createWalletClient.test.ts +2 -2
- package/src/clients/createWalletClient.ts +3 -5
- package/src/clients/decorators/arkivPublic.ts +13 -24
- package/src/clients/decorators/arkivWallet.ts +40 -47
- package/src/entity/create.test.ts +20 -1
- package/src/entity/errors.ts +4 -3
- package/src/entity/expiry.ts +1 -0
- package/src/entity/index.ts +2 -2
- package/src/entity/key.ts +23 -3
- package/src/entity/operations.ts +1 -0
- package/src/index.ts +0 -13
- package/src/query/engine.ts +0 -11
- package/src/query/errors.ts +1 -1
- package/src/query/expression.ts +14 -7
- package/src/query/queryBuilder.test.ts +1 -21
- package/src/query/queryBuilder.ts +3 -10
- package/src/types/index.ts +4 -4
- package/src/types/rpcSchema.ts +1 -0
- package/src/types/txParams.ts +8 -0
- package/src/utils/arkivTransactions.test.ts +7 -1
- package/src/utils/arkivTransactions.ts +114 -254
- package/src/utils/expirationTime.ts +39 -0
- package/src/utils/payload.ts +25 -0
- package/dist/actions/advanced/index.cjs +0 -13
- package/dist/actions/advanced/index.d.cts +0 -8
- package/dist/actions/advanced/index.d.ts +0 -9
- package/dist/actions/advanced/index.js +0 -9
- package/dist/advanced-8ZPTmmaN.js +0 -598
- package/dist/advanced-8ZPTmmaN.js.map +0 -1
- package/dist/advanced-fPImL6lW.cjs +0 -656
- package/dist/arkivTransactions-D74gERHG.d.cts.map +0 -1
- package/dist/arkivTransactions-NtGD6uk5.d.ts.map +0 -1
- package/dist/attributes-BhY5DwJp.js.map +0 -1
- package/dist/chains-BJrZs6sG.js.map +0 -1
- package/dist/codec-Car3KkFF.d.ts +0 -102
- package/dist/codec-Car3KkFF.d.ts.map +0 -1
- package/dist/entity-B7G8q_Eo.cjs +0 -0
- package/dist/entity-CD_qFF2M.js +0 -0
- package/dist/errors-LTe7bOYS.js.map +0 -1
- package/dist/expiry-BjpxZZQU.js.map +0 -1
- package/dist/index-B5j76711.d.ts +0 -184
- package/dist/index-B5j76711.d.ts.map +0 -1
- package/dist/index-CA4V7Pdh.d.cts.map +0 -1
- package/dist/index-CV5zCdpa.d.cts.map +0 -1
- package/dist/index-DvYvrkdk.d.ts.map +0 -1
- package/dist/index-EeUO0nnJ.d.cts +0 -184
- package/dist/index-EeUO0nnJ.d.cts.map +0 -1
- package/dist/index-fX_XyqLp.d.ts.map +0 -1
- package/dist/key-D1Bh7MF0.js.map +0 -1
- package/dist/logger-CVpvU8ik.js +0 -153
- package/dist/logger-CVpvU8ik.js.map +0 -1
- package/dist/logger-Cr15lPAQ.cjs +0 -188
- package/dist/payload-BNoud2KZ.d.cts.map +0 -1
- package/dist/payload-Bz6651ax.js.map +0 -1
- package/dist/payload-CcUj85ys.d.ts.map +0 -1
- package/dist/queryBuilder-DM6AWCBa.js.map +0 -1
- package/dist/selection-C4UhsMOO.d.ts.map +0 -1
- package/dist/selection-DPg0uyJf.d.cts.map +0 -1
- package/dist/types-Bu_ZwMbZ.js +0 -0
- package/dist/types-NRqymi6S.cjs +0 -0
- package/src/actions/advanced/advanced.test.ts +0 -258
- package/src/actions/advanced/buildMutation.ts +0 -104
- package/src/actions/advanced/getMutationResult.ts +0 -112
- package/src/actions/advanced/index.ts +0 -21
- package/src/actions/advanced/pingTransaction.ts +0 -43
- package/src/actions/advanced/sendMutation.ts +0 -59
- package/src/clients/decorators/arkivAdvanced.ts +0 -144
- /package/dist/{entity-B00Li04j.cjs → entity-B0t6sN7F.cjs} +0 -0
- /package/dist/{attr-DlmErkvR.cjs → types-Bx1EKe0v.js} +0 -0
- /package/dist/{attr-GcQKatub.js → types-CKPddlfS.cjs} +0 -0
|
@@ -1,6 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Hex } from "viem";
|
|
1
|
+
import { Address, Hex } from "viem";
|
|
3
2
|
|
|
3
|
+
//#region src/attr/types.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The protocol's attribute type vocabulary, mapping each short **tag** (the name used by the
|
|
7
|
+
* client, the query language and this SDK) to its **typeId** (the byte carried on the wire and in
|
|
8
|
+
* the entity record).
|
|
9
|
+
*
|
|
10
|
+
* The typeIds are consensus-critical: they are written into entity records and mixed into index
|
|
11
|
+
* keys, so this table must never drift from the node's `AttributeType`.
|
|
12
|
+
*
|
|
13
|
+
* | tag | typeId | ABI wire type | indexing |
|
|
14
|
+
* | --------- | ------ | ------------------- | ----------------- |
|
|
15
|
+
* | `bool` | 1 | `bool` | equality |
|
|
16
|
+
* | `i32` | 2 | `int32` | equality + range |
|
|
17
|
+
* | `u64` | 3 | `uint64` | equality + range |
|
|
18
|
+
* | `u256` | 4 | `uint256` | equality + range |
|
|
19
|
+
* | `dec` | 5 | `int256` (18 dp) | equality + range |
|
|
20
|
+
* | `bytes32` | 6 | `bytes32` | equality |
|
|
21
|
+
* | `bytes` | 7 | `bytes` | none — system-only |
|
|
22
|
+
* | `str` | 8 | `string` (<= 128 B) | equality + prefix |
|
|
23
|
+
* | `addr` | 9 | `address` | equality |
|
|
24
|
+
* | `key` | 10 | `bytes32` | equality |
|
|
25
|
+
*/
|
|
26
|
+
declare const TYPE_IDS: {
|
|
27
|
+
readonly bool: 1;
|
|
28
|
+
readonly i32: 2;
|
|
29
|
+
readonly u64: 3;
|
|
30
|
+
readonly u256: 4;
|
|
31
|
+
readonly dec: 5;
|
|
32
|
+
readonly bytes32: 6;
|
|
33
|
+
readonly bytes: 7;
|
|
34
|
+
readonly str: 8;
|
|
35
|
+
readonly addr: 9;
|
|
36
|
+
readonly key: 10;
|
|
37
|
+
};
|
|
38
|
+
/** Every type tag, including the system-only `bytes`. */
|
|
39
|
+
type TypeTag = keyof typeof TYPE_IDS;
|
|
40
|
+
/**
|
|
41
|
+
* The tags a client may set on an attribute. `bytes` is excluded: it backs the system `$payload`
|
|
42
|
+
* cell, which travels in its own operation field and is never carried in an attribute array.
|
|
43
|
+
*/
|
|
44
|
+
type UserTypeTag = Exclude<TypeTag, "bytes">;
|
|
45
|
+
/**
|
|
46
|
+
* Marks a value as having passed its constructor's validation. The symbol is module-private, so a
|
|
47
|
+
* hand-written object literal is not assignable to {@link ArkivValue} — every value crossing the
|
|
48
|
+
* wire has been range-, length- and format-checked by `i32`, `u256`, `dec`, and friends.
|
|
49
|
+
*/
|
|
50
|
+
declare const validated: unique symbol;
|
|
51
|
+
/**
|
|
52
|
+
* A typed attribute value: the tag it was created with, plus the JavaScript representation of that
|
|
53
|
+
* type. Constructed only by the tagged constructors in `@arkiv-network/sdk/attr`.
|
|
54
|
+
*
|
|
55
|
+
* @typeParam tag - The type tag, which also discriminates the {@link ArkivValue} union.
|
|
56
|
+
* @typeParam value - The decoded JavaScript representation.
|
|
57
|
+
*/
|
|
58
|
+
type Value<tag extends TypeTag, value> = {
|
|
59
|
+
readonly type: tag;
|
|
60
|
+
readonly value: value;
|
|
61
|
+
readonly [validated]: tag;
|
|
62
|
+
};
|
|
63
|
+
/** A boolean. */
|
|
64
|
+
type BoolValue = Value<"bool", boolean>;
|
|
65
|
+
/** A 32-bit signed integer — the default for an untagged number. */
|
|
66
|
+
type I32Value = Value<"i32", number>;
|
|
67
|
+
/**
|
|
68
|
+
* A 64-bit unsigned integer — block heights, the
|
|
69
|
+
* entity-nonce and `$expiresAt` are all `u64` */
|
|
70
|
+
type U64Value = Value<"u64", bigint>;
|
|
71
|
+
/** A 256-bit unsigned integer. */
|
|
72
|
+
type U256Value = Value<"u256", bigint>;
|
|
73
|
+
/**
|
|
74
|
+
* A fixed-point decimal with 18 decimal places, held as its canonical decimal string (`"3.5"`).
|
|
75
|
+
* Use {@link decUnits} for the exact scaled integer when you need to do arithmetic.
|
|
76
|
+
*/
|
|
77
|
+
type DecValue = Value<"dec", string>;
|
|
78
|
+
/** 32 opaque bytes, as lowercase `0x` hex. */
|
|
79
|
+
type Bytes32Value = Value<"bytes32", Hex>;
|
|
80
|
+
/** A UTF-8 string of at most 128 bytes, free of C0 control characters and DEL. */
|
|
81
|
+
type StrValue = Value<"str", string>;
|
|
82
|
+
/** A 20-byte Ethereum address, as EIP-55 checksummed hex. */
|
|
83
|
+
type AddrValue = Value<"addr", Address>;
|
|
84
|
+
/** A reference to another entity. Weak by spec: dangling references are permitted. */
|
|
85
|
+
type KeyValue = Value<"key", Hex>;
|
|
86
|
+
/**
|
|
87
|
+
* Opaque variable-length bytes, as lowercase `0x` hex. System-only — it backs `$payload` and is
|
|
88
|
+
* never settable as an attribute, so it is produced by decoding but has no constructor.
|
|
89
|
+
*/
|
|
90
|
+
type BytesValue = Value<"bytes", Hex>;
|
|
91
|
+
/** Any value a client may set on an attribute. */
|
|
92
|
+
type ArkivValue = BoolValue | I32Value | U64Value | U256Value | DecValue | Bytes32Value | StrValue | AddrValue | KeyValue;
|
|
93
|
+
/** Any value that can come back from the node, including the system-only `bytes`. */
|
|
94
|
+
type AnyArkivValue = ArkivValue | BytesValue;
|
|
95
|
+
/**
|
|
96
|
+
* Whether `input` has the *shape* of an {@link ArkivValue} — a known type tag and a value.
|
|
97
|
+
*/
|
|
98
|
+
declare function isArkivValue(input: unknown): input is AnyArkivValue;
|
|
99
|
+
//#endregion
|
|
4
100
|
//#region src/attr/values.d.ts
|
|
5
101
|
/** The widest `i32`. */
|
|
6
102
|
declare const I32_MAX = 2147483647;
|
|
@@ -108,7 +204,11 @@ declare function decFromUnits(units: bigint): DecValue;
|
|
|
108
204
|
*
|
|
109
205
|
* The limit is on **bytes**, not characters: a string of 128 emoji does not fit.
|
|
110
206
|
*
|
|
111
|
-
*
|
|
207
|
+
* C0 control characters and DEL are rejected: the query language writes a `str` as `str('...')`,
|
|
208
|
+
* whose only escape is a doubled quote, so a control character could be stored but never queried.
|
|
209
|
+
*
|
|
210
|
+
* @throws {InvalidValueError} If the value is not a string, holds a control character, or exceeds
|
|
211
|
+
* 128 UTF-8 bytes.
|
|
112
212
|
*
|
|
113
213
|
* @example
|
|
114
214
|
* str("Bob")
|
|
@@ -199,11 +299,15 @@ declare function toValue(input: ValueInput, attributeName?: string): ArkivValue;
|
|
|
199
299
|
* The most attribute cells one operation may carry.
|
|
200
300
|
*/
|
|
201
301
|
declare const MAX_ATTRIBUTES = 32;
|
|
302
|
+
/**
|
|
303
|
+
* The largest payload an entity may carry, in bytes. The payload travels as the `$payload` system
|
|
304
|
+
* cell, so this is a bound on that one attribute rather than on the operation as a whole.
|
|
305
|
+
*/
|
|
202
306
|
declare const MAX_PAYLOAD_BYTES: number;
|
|
203
307
|
/**
|
|
204
308
|
* The attributes written on an entity, as a plain object keyed by attribute name.
|
|
205
309
|
*
|
|
206
|
-
* Values may be tagged ({@link
|
|
310
|
+
* Values may be tagged ({@link ArkivValue}) or bare where the type is unambiguous — see
|
|
207
311
|
* {@link toValue} for the bare-form defaults.
|
|
208
312
|
*
|
|
209
313
|
* @example
|
|
@@ -316,5 +420,5 @@ declare function validateAttributeName(name: string): void;
|
|
|
316
420
|
/** Whether `name` is a valid attribute name — the non-throwing form of {@link validateAttributeName}. */
|
|
317
421
|
declare function isValidAttributeName(name: string): boolean;
|
|
318
422
|
//#endregion
|
|
319
|
-
export { i32 as A, ValueInput as C, dec as D, bytes32 as E, u64 as F, str as M, toValue as N, decFromUnits as O, u256 as P, U64_MAX as S, bool as T, MAX_PAYLOAD_BYTES as _, InvalidAttributeNameError as a, MAX_STRING_BYTES as b, TooManyAttributesError as c, DECIMAL_SCALE as d, DECIMAL_UNIT as f, MAX_ATTRIBUTES as g, Attributes as h, ConflictingMutationError as i, key as j, decUnits as k, UnknownAttributeTypeError as l, AttributeSchema as m, isValidAttributeName as n, InvalidValueError as o, AttributeInputs as p, validateAttributeName as r, MissingValueError as s, MAX_NAME_BYTES as t, UntypedValueError as u, I32_MAX as v, addr as w, U256_MAX as x, I32_MIN as y };
|
|
320
|
-
//# sourceMappingURL=index-
|
|
423
|
+
export { i32 as A, Bytes32Value as B, ValueInput as C, dec as D, bytes32 as E, u64 as F, StrValue as G, DecValue as H, AddrValue as I, U64Value as J, TypeTag as K, AnyArkivValue as L, str as M, toValue as N, decFromUnits as O, u256 as P, ArkivValue as R, U64_MAX as S, bool as T, I32Value as U, BytesValue as V, KeyValue as W, isArkivValue as X, UserTypeTag as Y, MAX_PAYLOAD_BYTES as _, InvalidAttributeNameError as a, MAX_STRING_BYTES as b, TooManyAttributesError as c, DECIMAL_SCALE as d, DECIMAL_UNIT as f, MAX_ATTRIBUTES as g, Attributes as h, ConflictingMutationError as i, key as j, decUnits as k, UnknownAttributeTypeError as l, AttributeSchema as m, isValidAttributeName as n, InvalidValueError as o, AttributeInputs as p, U256Value as q, validateAttributeName as r, MissingValueError as s, MAX_NAME_BYTES as t, UntypedValueError as u, I32_MAX as v, addr as w, U256_MAX as x, I32_MIN as y, BoolValue as z };
|
|
424
|
+
//# sourceMappingURL=index-CIcHPx2j.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CIcHPx2j.d.cts","names":[],"sources":["../src/attr/types.ts","../src/attr/values.ts","../src/attr/attributes.ts","../src/attr/decimal.ts","../src/attr/errors.ts","../src/attr/names.ts"],"sourcesContent":[],"mappings":";;;;;;AAwBA;AAcA;AASA;AAKC;AAgBD;;;;;;;AAOA;AAEA;AAIA;AAEA;AAKA;AAEA;AAEA;AAEA;AAEY,cAxEC,QAwEuB,EAAA;EAKxB,SAAA,IAAU,EAAA,CAAA;EA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,CJgEX;EAEhB,SAAA,KAAS,EAAA,OAAA;EAET,WAAQ,CAAA,KAAA,EAAA,OAAgB;AAKpC;AAGA;;;;;;;AAOI,cI9DS,iBAAA,SAA0B,KAAA,CJ8DnC;EACA;EACA,SAAA,aAAA,EAAA,MAAA,GAAA,SAAA;EAAQ,WAAA,CAAA,KAAA,EAAA,IAAA,GAAA,SAAA,EAAA,aAAA,CAAA,EAAA,MAAA;AAGZ;AAsBA;cIrEa,yBAAA,SAAkC,KAAA;;;AHxC/C;AAEA;AAEA;AAEA;AAIa,cG8CA,wBAAA,SAAiC,KAAA,CH9CjB;EAsBb,SAAI,aAAkB,EAAA,MAAS;EAkB/B,WAAG,CAAA,aAA0B,EAAQ,MAAA;AA8CrD;AAoBA;AAgFgB,cG7HH,sBAAA,SAA+B,KAAA,CH6HkB;EA6B9C,WAAQ,CAAA,KAAA,EAAA,MAAQ,EAAA,GAAA,EAAQ,MAAA;AAUxC;AAkBA;AAwCgB,cGtNH,yBAAA,SAAkC,KAAA,CHsND;EA8B9B;EAAW,SAAA,IAAA,EAAA,MAAA,GAAA,MAAA;EAAM,WAAA,CAAA,IAAA,EAAA,MAAA,GAAA,MAAA;;;;;cI7VpB,cAAA;;ALqBb;AAcA;AASA;AAKC;AAgBD;;;AAEkB,iBKhBF,qBAAA,CLgBE,IAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;AACN,iBK2BI,oBAAA,CL3BJ,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA"}
|
|
@@ -45,8 +45,7 @@ type UserTypeTag = Exclude<TypeTag, "bytes">;
|
|
|
45
45
|
/**
|
|
46
46
|
* Marks a value as having passed its constructor's validation. The symbol is module-private, so a
|
|
47
47
|
* hand-written object literal is not assignable to {@link ArkivValue} — every value crossing the
|
|
48
|
-
* wire has been range-, length- and format-checked by
|
|
49
|
-
* friends.
|
|
48
|
+
* wire has been range-, length- and format-checked by `i32`, `u256`, `dec`, and friends.
|
|
50
49
|
*/
|
|
51
50
|
declare const validated: unique symbol;
|
|
52
51
|
/**
|
|
@@ -78,7 +77,7 @@ type U256Value = Value<"u256", bigint>;
|
|
|
78
77
|
type DecValue = Value<"dec", string>;
|
|
79
78
|
/** 32 opaque bytes, as lowercase `0x` hex. */
|
|
80
79
|
type Bytes32Value = Value<"bytes32", Hex>;
|
|
81
|
-
/** A UTF-8 string of at most 128 bytes. */
|
|
80
|
+
/** A UTF-8 string of at most 128 bytes, free of C0 control characters and DEL. */
|
|
82
81
|
type StrValue = Value<"str", string>;
|
|
83
82
|
/** A 20-byte Ethereum address, as EIP-55 checksummed hex. */
|
|
84
83
|
type AddrValue = Value<"addr", Address>;
|
|
@@ -205,7 +204,11 @@ declare function decFromUnits(units: bigint): DecValue;
|
|
|
205
204
|
*
|
|
206
205
|
* The limit is on **bytes**, not characters: a string of 128 emoji does not fit.
|
|
207
206
|
*
|
|
208
|
-
*
|
|
207
|
+
* C0 control characters and DEL are rejected: the query language writes a `str` as `str('...')`,
|
|
208
|
+
* whose only escape is a doubled quote, so a control character could be stored but never queried.
|
|
209
|
+
*
|
|
210
|
+
* @throws {InvalidValueError} If the value is not a string, holds a control character, or exceeds
|
|
211
|
+
* 128 UTF-8 bytes.
|
|
209
212
|
*
|
|
210
213
|
* @example
|
|
211
214
|
* str("Bob")
|
|
@@ -296,11 +299,15 @@ declare function toValue(input: ValueInput, attributeName?: string): ArkivValue;
|
|
|
296
299
|
* The most attribute cells one operation may carry.
|
|
297
300
|
*/
|
|
298
301
|
declare const MAX_ATTRIBUTES = 32;
|
|
302
|
+
/**
|
|
303
|
+
* The largest payload an entity may carry, in bytes. The payload travels as the `$payload` system
|
|
304
|
+
* cell, so this is a bound on that one attribute rather than on the operation as a whole.
|
|
305
|
+
*/
|
|
299
306
|
declare const MAX_PAYLOAD_BYTES: number;
|
|
300
307
|
/**
|
|
301
308
|
* The attributes written on an entity, as a plain object keyed by attribute name.
|
|
302
309
|
*
|
|
303
|
-
* Values may be tagged ({@link
|
|
310
|
+
* Values may be tagged ({@link ArkivValue}) or bare where the type is unambiguous — see
|
|
304
311
|
* {@link toValue} for the bare-form defaults.
|
|
305
312
|
*
|
|
306
313
|
* @example
|
|
@@ -414,4 +421,4 @@ declare function validateAttributeName(name: string): void;
|
|
|
414
421
|
declare function isValidAttributeName(name: string): boolean;
|
|
415
422
|
//#endregion
|
|
416
423
|
export { i32 as A, Bytes32Value as B, ValueInput as C, dec as D, bytes32 as E, u64 as F, StrValue as G, DecValue as H, AddrValue as I, U64Value as J, TypeTag as K, AnyArkivValue as L, str as M, toValue as N, decFromUnits as O, u256 as P, ArkivValue as R, U64_MAX as S, bool as T, I32Value as U, BytesValue as V, KeyValue as W, isArkivValue as X, UserTypeTag as Y, MAX_PAYLOAD_BYTES as _, InvalidAttributeNameError as a, MAX_STRING_BYTES as b, TooManyAttributesError as c, DECIMAL_SCALE as d, DECIMAL_UNIT as f, MAX_ATTRIBUTES as g, Attributes as h, ConflictingMutationError as i, key as j, decUnits as k, UnknownAttributeTypeError as l, AttributeSchema as m, isValidAttributeName as n, InvalidValueError as o, AttributeInputs as p, U256Value as q, validateAttributeName as r, MissingValueError as s, MAX_NAME_BYTES as t, UntypedValueError as u, I32_MAX as v, addr as w, U256_MAX as x, I32_MIN as y, BoolValue as z };
|
|
417
|
-
//# sourceMappingURL=index-
|
|
424
|
+
//# sourceMappingURL=index-Cd2aaWme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Cd2aaWme.d.ts","names":[],"sources":["../src/attr/types.ts","../src/attr/values.ts","../src/attr/attributes.ts","../src/attr/decimal.ts","../src/attr/errors.ts","../src/attr/names.ts"],"sourcesContent":[],"mappings":";;;;;;AAwBA;AAcA;AASA;AAKC;AAgBD;;;;;;;AAOA;AAEA;AAIA;AAEA;AAKA;AAEA;AAEA;AAEA;AAEY,cAxEC,QAwEuB,EAAA;EAKxB,SAAA,IAAU,EAAA,CAAA;EAGV,SAAA,GAAA,EAAU,CAAA;EAClB,SAAA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;EAET,WAAQ,CAAA,KAAA,EAAA,OAAgB;AAKpC;AAGA;;;;;;;AAOI,cI9DS,iBAAA,SAA0B,KAAA,CJ8DnC;EACA;EACA,SAAA,aAAA,EAAA,MAAA,GAAA,SAAA;EAAQ,WAAA,CAAA,KAAA,EAAA,IAAA,GAAA,SAAA,EAAA,aAAA,CAAA,EAAA,MAAA;AAGZ;AAsBA;cIrEa,yBAAA,SAAkC,KAAA;;;AHxC/C;AAEA;AAEA;AAEA;AAIa,cG8CA,wBAAA,SAAiC,KAAA,CH9CjB;EAsBb,SAAI,aAAkB,EAAA,MAAS;EAkB/B,WAAG,CAAA,aAA0B,EAAA,MAAQ;AA8CrD;AAoBA;AAgFgB,cG7HH,sBAAA,SAA+B,KAAA,CH6HkB;EA6B9C,WAAQ,CAAA,KAAA,EAAA,MAAQ,EAAA,GAAA,EAAA,MAAQ;AAUxC;AAkBA;AAwCgB,cGtNH,yBAAA,SAAkC,KAAA,CHsND;EA8B9B;EAAW,SAAA,IAAA,EAAA,MAAA,GAAA,MAAA;EAAM,WAAA,CAAA,IAAA,EAAA,MAAA,GAAA,MAAA;;;;;cI7VpB,cAAA;;ALqBb;AAcA;AASA;AAKC;AAgBD;;;AAEkB,iBKhBF,qBAAA,CLgBE,IAAA,EAAA,MAAA,CAAA,EAAA,IAAA;;AACN,iBK2BI,oBAAA,CL3BJ,IAAA,EAAA,MAAA,CAAA,EAAA,OAAA"}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import { Address, Hex } from "viem";
|
|
2
2
|
|
|
3
|
-
//#region src/entity/operations.d.ts
|
|
4
|
-
|
|
5
|
-
/** One entry of the `execute` batch: the operation tag and its ABI-encoded payload. */
|
|
6
|
-
type Operation = {
|
|
7
|
-
operation: number;
|
|
8
|
-
operationData: Hex;
|
|
9
|
-
};
|
|
10
|
-
//#endregion
|
|
11
3
|
//#region src/entity/errors.d.ts
|
|
12
4
|
/** An expiry could not be expressed, or would be rejected by the engine. */
|
|
13
5
|
declare class InvalidExpiryError extends Error {
|
|
@@ -19,7 +11,7 @@ declare class InvalidCreationFlagsError extends Error {
|
|
|
19
11
|
}
|
|
20
12
|
/** A key salt was outside the `uint128` the wire carries. */
|
|
21
13
|
declare class InvalidSaltError extends Error {
|
|
22
|
-
constructor(salt:
|
|
14
|
+
constructor(salt: unknown);
|
|
23
15
|
}
|
|
24
16
|
/** No cryptographic randomness was available to generate a salt. */
|
|
25
17
|
declare class NoRandomSourceError extends Error {
|
|
@@ -111,6 +103,16 @@ type EntityEventName = (typeof ENTITY_EVENTS_ABI)[number]["name"];
|
|
|
111
103
|
//#region src/entity/key.d.ts
|
|
112
104
|
/** The widest salt the `uint128` wire field carries. */
|
|
113
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;
|
|
114
116
|
/**
|
|
115
117
|
* A cryptographically random 128-bit salt — what {@link CreateEntityParameters.salt} defaults to.
|
|
116
118
|
*
|
|
@@ -142,8 +144,8 @@ declare function predictEntityKey({
|
|
|
142
144
|
* create in a batch uses `nonce + n`.
|
|
143
145
|
*/
|
|
144
146
|
nonce: bigint;
|
|
145
|
-
/** The salt the create will carry. */
|
|
146
|
-
salt:
|
|
147
|
+
/** The salt the create will carry, or {@link NO_SALT} if it carries none. */
|
|
148
|
+
salt: SaltInput;
|
|
147
149
|
/** The chain the entity is being created on — half of the derivation domain. */
|
|
148
150
|
chainId: number;
|
|
149
151
|
}): Hex;
|
|
@@ -163,5 +165,5 @@ declare const OperationType: {
|
|
|
163
165
|
};
|
|
164
166
|
type OperationType = (typeof OperationType)[keyof typeof OperationType];
|
|
165
167
|
//#endregion
|
|
166
|
-
export {
|
|
167
|
-
//# sourceMappingURL=index-
|
|
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-ezMZ2-JH.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-ezMZ2-JH.d.ts","names":[],"sources":["../src/entity/errors.ts","../src/entity/events.ts","../src/entity/key.ts","../src/entity/params.ts"],"sourcesContent":[],"mappings":";;;;cACa,kBAAA,SAA2B,KAAA;;AAAxC;AAQA;AAQa,cARA,yBAAA,SAAkC,KAAA,CAQJ;EAY9B,WAAA,CAAA,MAAA,EAAA,MAAoB;;;cAZpB,gBAAA,SAAyB,KAAA;ECXzB,WAAA,CAAA,IAAA,EAAA,OAMX;AAGF;;cDca,mBAAA,SAA4B,KAAA;;AEvBzC;;;;;;AFLA;AAQa,cCHA,iBDG0B,EAAA,SAAQ,CAAK;EAQvC,SAAA,IAAA,EAAA,eAAiB;EAYjB,SAAA,IAAA,EAAA,OAAoB;;;;ICvBpB,SAAA,OAMX,EAAA,IAAA;EAGU,CAAA,EAAA;;;;ECTC,CAAA,EAAA;IAOA,SAA2B,IAAA,EAAA,QAAA;IAK5B,SAAS,IAAA,EAAA,WAAmB;EAWxB,CAAA,EAAA;IAkCA,SAAA,IAAA,EAAgB,OAAA;IAC9B,SAAA,IAAA,EAAA,eAAA;EACA,CAAA,CAAA;CACA,EAAA;EACA,SAAA,IAAA,EAAA,eAAA;EAGO,SAAA,IAAA,EAAA,OAAA;EAOD,SAAA,MAAA,EAAA,SAAA,CAAA;IAGJ,SAAA,IAAA,EAAA,SAAA;IAAG,SAAA,IAAA,EAAA,WAAA;;;;IC7EM,SAAA,IAA+B,EAAA,OAAA;IAG/B,SAAA,OAMH,EAAA,IAAA;EAEE,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KFCA,eAAA,WAA0B;;;;cCTzB;AFLb;AAQA;AAQA;AAYA;;cEhBa;;ADPb;AASA;KCGY,SAAA,mBAA4B;;;AAZxC;AAOA;AAKA;AAWA;AAkCA;;;AAGE,iBArCc,UAAA,CAAA,CAqCd,EAAA,MAAA;;;AC/DF;AAGA;AAQA;;;;iBDiDgB,gBAAA;;;;;;;SAOP;;;;;;;QAOD;;;IAGJ;;;;;;AF/ES,cGEA,cHFmB,EAAQ,MAAK;AAQ7C;AAQa,cGXA,aHWiB,EAAQ;EAYzB,SAAA,MAAA,EAAA,CAAA;;;;ECvBA,SAAA,MAAA,EAAA,CAAA;AASb,CAAA;KEDY,aAAA,WAAwB,4BAA4B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { K as TypeTag } from "./index-CIcHPx2j.cjs";
|
|
2
|
+
import { R as RpcSelect, d as Expression, i as SelectArg, j as ArkivClient, k as Entity } from "./selection-Bv8_o-7i.cjs";
|
|
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
|
*/
|
|
@@ -234,9 +234,7 @@ declare class SelectQueryBuilder<TEntity = Entity> {
|
|
|
234
234
|
*
|
|
235
235
|
* Pagination normally goes through {@link QueryResult.next}, which carries the cursor for you;
|
|
236
236
|
* this is for resuming a walk in a later process. A cursor is bound to the query, block and
|
|
237
|
-
* selection it came from, so it must be used with an identically-built query
|
|
238
|
-
* set to the `blockNumber` of the page the cursor came from is required (persist the two
|
|
239
|
-
* together), and a fetch with a cursor but no block rejects locally.
|
|
237
|
+
* selection it came from, so it must be used with an identically-built query.
|
|
240
238
|
*/
|
|
241
239
|
cursor(cursor: string): this;
|
|
242
240
|
/**
|
|
@@ -277,4 +275,4 @@ declare class SelectQueryBuilder<TEntity = Entity> {
|
|
|
277
275
|
}
|
|
278
276
|
//#endregion
|
|
279
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 };
|
|
280
|
-
//# sourceMappingURL=index-
|
|
278
|
+
//# sourceMappingURL=index-rINthNuU.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-rINthNuU.d.cts","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;;;;;;iBDz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