@arkiv-network/sdk 0.8.0-dev.1 → 0.8.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/attr/index.cjs +1 -1
- package/dist/attr/index.d.cts +1 -1
- package/dist/attr/index.d.ts +1 -1
- package/dist/attr/index.js +1 -1
- package/dist/{attr-BvxHN99W.cjs → attr-BXTkpnoc.cjs} +13 -3
- package/dist/{attr-BDZ-APg5.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/{changeOwnership-DwgtdSFc.d.ts → changeOwnership-B0ar96ub.d.ts} +47 -34
- package/dist/changeOwnership-B0ar96ub.d.ts.map +1 -0
- package/dist/{changeOwnership-B7bEgla4.d.cts → changeOwnership-BofkLnXJ.d.cts} +47 -34
- package/dist/changeOwnership-BofkLnXJ.d.cts.map +1 -0
- package/dist/entity/index.cjs +5 -4
- package/dist/entity/index.d.cts +2 -2
- package/dist/entity/index.d.ts +2 -2
- package/dist/entity/index.js +5 -5
- package/dist/{entity-CFhbAv0R.js → entity-CniBgBSd.js} +17 -5
- package/dist/entity-CniBgBSd.js.map +1 -0
- package/dist/{entity-wfBnZd91.cjs → entity-DJ0Gml9c.cjs} +23 -5
- package/dist/{errors-DGB8AgT2.js → errors-D2E1GRjw.js} +2 -2
- package/dist/errors-D2E1GRjw.js.map +1 -0
- package/dist/{errors-D-eJkGVc.cjs → errors-DhV00966.cjs} +1 -1
- package/dist/expiry-BxOlvVWC.d.ts.map +1 -1
- package/dist/{expiry-BUYIXTGb.cjs → expiry-CG9GhVXv.cjs} +1 -1
- package/dist/{expiry-DGRzrSan.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-Ct8k0gpB.cjs → flags-DCD26uhe.cjs} +1 -1
- package/dist/{flags-ZtlvOIIk.js → flags-DUT2gHEU.js} +2 -2
- package/dist/{flags-ZtlvOIIk.js.map → flags-DUT2gHEU.js.map} +1 -1
- package/dist/{index-D0CmtiWT.d.cts → index-BGp2plHs.d.cts} +15 -5
- package/dist/index-BGp2plHs.d.cts.map +1 -0
- package/dist/{index-VCqgn29D.d.ts → index-BKB875Um.d.ts} +4 -4
- package/dist/{index-VCqgn29D.d.ts.map → index-BKB875Um.d.ts.map} +1 -1
- package/dist/{index-DVYFaXNV.d.ts → index-CIcHPx2j.d.cts} +13 -6
- package/dist/index-CIcHPx2j.d.cts.map +1 -0
- package/dist/{index-D8LZt-3J.d.cts → index-Cd2aaWme.d.ts} +13 -6
- package/dist/index-Cd2aaWme.d.ts.map +1 -0
- package/dist/{index-ClgIuxJ8.d.ts → index-ezMZ2-JH.d.ts} +15 -5
- package/dist/index-ezMZ2-JH.d.ts.map +1 -0
- package/dist/{index-Cgw1u5aY.d.cts → index-rINthNuU.d.cts} +4 -4
- package/dist/{index-Cgw1u5aY.d.cts.map → index-rINthNuU.d.cts.map} +1 -1
- package/dist/index.cjs +41 -42
- package/dist/index.d.cts +56 -50
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +56 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -43
- package/dist/index.js.map +1 -1
- package/dist/{payload-Dgx3PQeK.d.ts → payload-CGvVPZQX.d.ts} +60 -1
- package/dist/payload-CGvVPZQX.d.ts.map +1 -0
- package/dist/{payload-CIxSn_DW.js → payload-DE7wMztL.js} +28 -3
- package/dist/payload-DE7wMztL.js.map +1 -0
- package/dist/{payload-P0nWyjLg.d.cts → payload-Dfu30njp.d.cts} +60 -1
- package/dist/payload-Dfu30njp.d.cts.map +1 -0
- package/dist/{payload-Bnw1hrvb.cjs → payload-DqFweqiO.cjs} +27 -2
- package/dist/query/index.cjs +4 -4
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +4 -4
- package/dist/{queryBuilder-CbLL4pG5.js → queryBuilder-wvA8sn--.js} +14 -11
- package/dist/queryBuilder-wvA8sn--.js.map +1 -0
- package/dist/{queryBuilder-BXDvX1K_.cjs → queryBuilder-zHGhDmaG.cjs} +13 -10
- package/dist/{selection-BvK6yX0g.d.cts → selection-Bv8_o-7i.d.cts} +16 -8
- package/dist/selection-Bv8_o-7i.d.cts.map +1 -0
- package/dist/{selection-fpmI3ADQ.d.ts → selection-ox7zdtVm.d.ts} +16 -8
- package/dist/selection-ox7zdtVm.d.ts.map +1 -0
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +5 -5
- package/dist/utils/index.cjs +3 -3
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.ts +1 -1
- 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/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} +9 -9
- 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 -12
- package/src/clients/decorators/arkivWallet.ts +40 -32
- 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 -1
- package/src/entity/key.ts +23 -3
- package/src/entity/operations.ts +1 -0
- package/src/query/errors.ts +1 -1
- package/src/query/expression.ts +14 -7
- package/src/query/queryBuilder.ts +1 -1
- 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 +2 -2
- package/src/utils/expirationTime.ts +39 -0
- package/src/utils/payload.ts +25 -0
- package/dist/attr-BDZ-APg5.js.map +0 -1
- package/dist/chains-BJrZs6sG.js.map +0 -1
- package/dist/changeOwnership-B7bEgla4.d.cts.map +0 -1
- package/dist/changeOwnership-DwgtdSFc.d.ts.map +0 -1
- package/dist/entity-CFhbAv0R.js.map +0 -1
- package/dist/errors-DGB8AgT2.js.map +0 -1
- package/dist/expiry-DGRzrSan.js.map +0 -1
- package/dist/index-ClgIuxJ8.d.ts.map +0 -1
- package/dist/index-D0CmtiWT.d.cts.map +0 -1
- package/dist/index-D8LZt-3J.d.cts.map +0 -1
- package/dist/index-DVYFaXNV.d.ts.map +0 -1
- package/dist/payload-CIxSn_DW.js.map +0 -1
- package/dist/payload-Dgx3PQeK.d.ts.map +0 -1
- package/dist/payload-P0nWyjLg.d.cts.map +0 -1
- package/dist/queryBuilder-CbLL4pG5.js.map +0 -1
- package/dist/selection-BvK6yX0g.d.cts.map +0 -1
- package/dist/selection-fpmI3ADQ.d.ts.map +0 -1
|
@@ -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-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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,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,IAAA,CAAA,EAAA,MAAA;AAIrB;AAEA;AAIA;AAEA;AAKA;AAEA;AAEY,cIhEC,iBAAA,SAA0B,KAAA,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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AAA,CAAA,EAAA,MAAA;AAIrB;AAEA;AAIA;AAEA;AAKA;AAEA;AAEY,cIhEC,iBAAA,SAA0B,KAAA,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,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"}
|
|
@@ -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:
|
|
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:
|
|
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 {
|
|
159
|
-
//# 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 { K as TypeTag } from "./index-
|
|
2
|
-
import { R as RpcSelect, d as Expression, i as SelectArg, j as ArkivClient, k as Entity } from "./selection-
|
|
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
|
*/
|
|
@@ -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-
|
|
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;;;;;;iBDzDsB,QAAA,SAAiB,sBAAsB,eAAe,QAAQ;;;;;;;AA9BpF;AAGA;AAcA;AAaA;;;;;;;cCxBa,wBAAA,SAAiC,KAAA;;EAAjC,SAAA,aAAA,EAAA,MAAyB;EAMtB;EAE4C,SAAA,QAAA,EAAA,MAAA;EARd;EAAK,SAAA,GAAA,EAMnC,OANmC;EAyBtC,WAAA,CAAA,aAAsB,EAAA,MAAA,EAAQ,QAAK,EAAA,MAAA,EAAA,GAAA,EAjBY,OAiBZ,EAAA,IAAA,CAAA,EAAA,MAAA;AAgBhD;AAwCA;;;;;cAxDa,qBAAA,SAA8B,KAAA;;;ECrCtC,WAAA,CAAS,OAAA,EAAA,MAAA,EAAA,aAAA,CAAA,EAAA,MAAA;;;;;AAgBd;;AAE8B,KDmClB,cAAA;;+GCSwB;kHAApB;;;ACzBhB,0DAA0C,OAAA;;;;;;;;;;;;;;;;;cF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|
|
|
1
|
-
const require_chains = require('./chains-
|
|
2
|
-
const require_attr = require('./attr-
|
|
3
|
-
const require_queryBuilder = require('./queryBuilder-
|
|
4
|
-
const require_errors = require('./errors-
|
|
5
|
-
const require_flags = require('./flags-
|
|
1
|
+
const require_chains = require('./chains-BfNQliHU.cjs');
|
|
2
|
+
const require_attr = require('./attr-BXTkpnoc.cjs');
|
|
3
|
+
const require_queryBuilder = require('./queryBuilder-zHGhDmaG.cjs');
|
|
4
|
+
const require_errors = require('./errors-DhV00966.cjs');
|
|
5
|
+
const require_flags = require('./flags-DCD26uhe.cjs');
|
|
6
6
|
const require_entity = require('./entity-B0t6sN7F.cjs');
|
|
7
|
-
const require_expiry = require('./expiry-
|
|
8
|
-
const require_entity$1 = require('./entity-
|
|
7
|
+
const require_expiry = require('./expiry-CG9GhVXv.cjs');
|
|
8
|
+
const require_entity$1 = require('./entity-DJ0Gml9c.cjs');
|
|
9
9
|
require('./types-CKPddlfS.cjs');
|
|
10
|
-
const require_payload = require('./payload-
|
|
10
|
+
const require_payload = require('./payload-DqFweqiO.cjs');
|
|
11
11
|
let viem = require("viem");
|
|
12
12
|
let viem_actions = require("viem/actions");
|
|
13
13
|
|
|
@@ -182,7 +182,7 @@ async function getEntityNonce(client, owner) {
|
|
|
182
182
|
*
|
|
183
183
|
* The prediction is valid only while nothing else from this owner is in flight. Every create that
|
|
184
184
|
* lands first takes the nonce with it and moves these keys. For a key you can rely on
|
|
185
|
-
* unconditionally, read it back from the create instead — `createEntity` and `
|
|
185
|
+
* unconditionally, read it back from the create instead — `createEntity` and `executeBatch`
|
|
186
186
|
* report the keys the engine actually minted.
|
|
187
187
|
*
|
|
188
188
|
* @param parameters - Owner, and either a count or the salts. {@link PredictEntityKeysParameters}
|
|
@@ -192,7 +192,7 @@ async function getEntityNonce(client, owner) {
|
|
|
192
192
|
* import { key } from "@arkiv-network/sdk/attr"
|
|
193
193
|
*
|
|
194
194
|
* const [parent, child] = await client.predictEntityKeys({ owner: account.address, count: 2 })
|
|
195
|
-
* await
|
|
195
|
+
* await client.executeBatch({
|
|
196
196
|
* creates: [
|
|
197
197
|
* { payload, contentType, expires, salt: parent.salt },
|
|
198
198
|
* {
|
|
@@ -223,7 +223,7 @@ async function predictEntityKeys(client, { owner, count, salts }) {
|
|
|
223
223
|
function resolveSalts(count, salts) {
|
|
224
224
|
if (salts !== void 0) {
|
|
225
225
|
if (salts.length === 0) throw new Error("predictEntityKeys: `salts` is empty — there is nothing to predict");
|
|
226
|
-
return salts.map(require_entity$1.
|
|
226
|
+
return salts.map(require_entity$1.resolveSalt);
|
|
227
227
|
}
|
|
228
228
|
if (count === void 0) throw new Error("predictEntityKeys: pass either `count` or `salts`");
|
|
229
229
|
if (!Number.isInteger(count) || count <= 0) throw new Error(`predictEntityKeys: \`count\` must be a positive whole number, got ${count}`);
|
|
@@ -420,14 +420,14 @@ function publicArkivActions(client) {
|
|
|
420
420
|
//#endregion
|
|
421
421
|
//#region src/clients/createPublicClient.ts
|
|
422
422
|
/**
|
|
423
|
-
* Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/
|
|
423
|
+
* Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/chains/introduction).
|
|
424
424
|
*
|
|
425
|
-
* -
|
|
426
|
-
*
|
|
427
|
-
*
|
|
425
|
+
* A Public Client is an interface to the "public" [Ethereum JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/)
|
|
426
|
+
* and the Arkiv JSON-RPC API — retrieving block numbers and transactions, reading from
|
|
427
|
+
* contracts, and querying entities — through {@link PublicArkivActions}.
|
|
428
428
|
*
|
|
429
429
|
* @param parameters - Configuration object for the public client (chain, transport, etc.)
|
|
430
|
-
* @returns
|
|
430
|
+
* @returns An Arkiv Public Client. {@link PublicArkivClient}
|
|
431
431
|
*
|
|
432
432
|
* @example
|
|
433
433
|
* import { createPublicClient } from "@arkiv-network/sdk"
|
|
@@ -562,7 +562,7 @@ async function sendArkivTransaction(client, ops, txParams) {
|
|
|
562
562
|
const createOps = (creates ?? []).map((item) => {
|
|
563
563
|
validateContentType(item.contentType);
|
|
564
564
|
return createOperation({
|
|
565
|
-
salt: item.salt === void 0 ? require_entity$1.randomSalt() : require_entity$1.
|
|
565
|
+
salt: item.salt === void 0 ? require_entity$1.randomSalt() : require_entity$1.resolveSalt(item.salt),
|
|
566
566
|
expiry: require_expiry.resolveExpiry(item.expires, expiryContext),
|
|
567
567
|
creationFlags: require_flags.encodeCreationFlags(item.flags),
|
|
568
568
|
attributes: require_attr.encodeAttributes(item.attributes, {
|
|
@@ -733,13 +733,29 @@ async function deleteEntity(client, data, txParams) {
|
|
|
733
733
|
};
|
|
734
734
|
}
|
|
735
735
|
|
|
736
|
+
//#endregion
|
|
737
|
+
//#region src/actions/wallet/executeBatch.ts
|
|
738
|
+
const logger$2 = require_queryBuilder.getLogger("actions:wallet:execute-batch");
|
|
739
|
+
async function executeBatch(client, data, txParams) {
|
|
740
|
+
const { receipt, createdEntityKeys } = await sendArkivTransaction(client, data, txParams);
|
|
741
|
+
logger$2("Receipt from executeBatch %o", receipt);
|
|
742
|
+
return {
|
|
743
|
+
txHash: receipt.transactionHash,
|
|
744
|
+
createdEntities: createdEntityKeys,
|
|
745
|
+
patchedEntities: (data.patches ?? []).map((p) => p.entityKey),
|
|
746
|
+
deletedEntities: (data.deletes ?? []).map((d) => d.entityKey),
|
|
747
|
+
extendedEntities: (data.extensions ?? []).map((e) => e.entityKey),
|
|
748
|
+
ownershipChanges: (data.ownershipChanges ?? []).map((o) => o.entityKey)
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
|
|
736
752
|
//#endregion
|
|
737
753
|
//#region src/actions/wallet/extendEntity.ts
|
|
738
|
-
const logger$
|
|
754
|
+
const logger$1 = require_queryBuilder.getLogger("actions:wallet:extend-entity");
|
|
739
755
|
async function extendEntity(client, data, txParams) {
|
|
740
|
-
logger$
|
|
756
|
+
logger$1("extendEntity %o", data);
|
|
741
757
|
const { receipt, extendedExpiries } = await sendArkivTransaction(client, { extensions: [data] }, txParams);
|
|
742
|
-
logger$
|
|
758
|
+
logger$1("Receipt from extendEntity %o", receipt);
|
|
743
759
|
const [expiresAt] = extendedExpiries;
|
|
744
760
|
if (expiresAt === void 0) throw new require_queryBuilder.EntityMutationError(`Transaction ${receipt.transactionHash} succeeded, but the receipt did not carry the expected entity expiry.`);
|
|
745
761
|
return {
|
|
@@ -749,22 +765,6 @@ async function extendEntity(client, data, txParams) {
|
|
|
749
765
|
};
|
|
750
766
|
}
|
|
751
767
|
|
|
752
|
-
//#endregion
|
|
753
|
-
//#region src/actions/wallet/mutateEntities.ts
|
|
754
|
-
const logger$1 = require_queryBuilder.getLogger("actions:wallet:mutate-entities");
|
|
755
|
-
async function mutateEntities(client, data, txParams) {
|
|
756
|
-
const { receipt, createdEntityKeys } = await sendArkivTransaction(client, data, txParams);
|
|
757
|
-
logger$1("Receipt from mutateEntities %o", receipt);
|
|
758
|
-
return {
|
|
759
|
-
txHash: receipt.transactionHash,
|
|
760
|
-
createdEntities: createdEntityKeys,
|
|
761
|
-
patchedEntities: (data.patches ?? []).map((p) => p.entityKey),
|
|
762
|
-
deletedEntities: (data.deletes ?? []).map((d) => d.entityKey),
|
|
763
|
-
extendedEntities: (data.extensions ?? []).map((e) => e.entityKey),
|
|
764
|
-
ownershipChanges: (data.ownershipChanges ?? []).map((o) => o.entityKey)
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
|
|
768
768
|
//#endregion
|
|
769
769
|
//#region src/actions/wallet/patchEntity.ts
|
|
770
770
|
const logger = require_queryBuilder.getLogger("actions:wallet:patch-entity");
|
|
@@ -787,7 +787,7 @@ function walletArkivActions(client) {
|
|
|
787
787
|
deleteEntity: (data, txParams) => deleteEntity(client, data, txParams),
|
|
788
788
|
extendEntity: (data, txParams) => extendEntity(client, data, txParams),
|
|
789
789
|
changeOwnership: (data, txParams) => changeOwnership(client, data, txParams),
|
|
790
|
-
|
|
790
|
+
executeBatch: (data, txParams) => executeBatch(client, data, txParams)
|
|
791
791
|
};
|
|
792
792
|
}
|
|
793
793
|
|
|
@@ -795,16 +795,14 @@ function walletArkivActions(client) {
|
|
|
795
795
|
//#region src/clients/createWalletClient.ts
|
|
796
796
|
/**
|
|
797
797
|
* Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro) configured
|
|
798
|
-
* for a [Chain](https://viem.sh/docs/
|
|
799
|
-
*
|
|
800
|
-
* - Docs: https://docs.arkiv.network/ts-sdk/clients/wallet
|
|
798
|
+
* for a [Chain](https://viem.sh/docs/chains/introduction) and an account.
|
|
801
799
|
*
|
|
802
800
|
* A Wallet Client signs and sends transactions, so it carries an `account` and exposes everything
|
|
803
801
|
* that mutates state — `createEntity`, `patchEntity`, `deleteEntity`, `extendEntity`,
|
|
804
|
-
* `changeOwnership` and `
|
|
802
|
+
* `changeOwnership` and `executeBatch` — on top of the read actions a Public Client has.
|
|
805
803
|
*
|
|
806
804
|
* @param parameters - Configuration object for the wallet client (chain, transport, account, etc.)
|
|
807
|
-
* @returns
|
|
805
|
+
* @returns An Arkiv Wallet Client. {@link WalletArkivClient}
|
|
808
806
|
*
|
|
809
807
|
* @example
|
|
810
808
|
* import { createWalletClient } from "@arkiv-network/sdk"
|
|
@@ -866,6 +864,7 @@ exports.MAX_PAYLOAD_BYTES = require_attr.MAX_PAYLOAD_BYTES;
|
|
|
866
864
|
exports.MAX_SALT = require_entity$1.MAX_SALT;
|
|
867
865
|
exports.MAX_STRING_BYTES = require_attr.MAX_STRING_BYTES;
|
|
868
866
|
exports.MissingValueError = require_attr.MissingValueError;
|
|
867
|
+
exports.NO_SALT = require_entity$1.NO_SALT;
|
|
869
868
|
exports.NoEntityFoundError = require_queryBuilder.NoEntityFoundError;
|
|
870
869
|
exports.NoMoreResultsError = require_queryBuilder.NoMoreResultsError;
|
|
871
870
|
exports.NoRandomSourceError = require_errors.NoRandomSourceError;
|