@arkiv-network/sdk 0.8.0-advanced.2 → 0.8.0-advanced.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/advanced/index.cjs +6 -6
- package/dist/actions/advanced/index.d.cts +5 -5
- package/dist/actions/advanced/index.d.ts +6 -6
- package/dist/actions/advanced/index.js +6 -6
- package/dist/{advanced-fPImL6lW.cjs → advanced-Ds2XRflQ.cjs} +6 -6
- package/dist/{advanced-8ZPTmmaN.js → advanced-FZy7WoYR.js} +7 -7
- package/dist/advanced-FZy7WoYR.js.map +1 -0
- package/dist/{arkivTransactions-D74gERHG.d.cts → arkivTransactions-BpARZOsH.d.cts} +60 -47
- package/dist/arkivTransactions-BpARZOsH.d.cts.map +1 -0
- package/dist/{arkivTransactions-NtGD6uk5.d.ts → arkivTransactions-DfZ_yVDD.d.ts} +60 -47
- package/dist/arkivTransactions-DfZ_yVDD.d.ts.map +1 -0
- package/dist/attr/index.cjs +1 -1
- package/dist/attr/index.d.cts +1 -1
- package/dist/attr/index.d.ts +2 -2
- package/dist/attr/index.js +1 -1
- package/dist/{attributes-BhY5DwJp.js → attributes-BJGuhsqp.js} +14 -4
- package/dist/attributes-BJGuhsqp.js.map +1 -0
- package/dist/{attributes-Df9IsCVs.cjs → attributes-CMJlp1wn.cjs} +13 -3
- 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/{codec-Car3KkFF.d.ts → codec-M74UR1_0.d.ts} +3 -4
- package/dist/codec-M74UR1_0.d.ts.map +1 -0
- package/dist/entity/index.cjs +5 -4
- package/dist/entity/index.d.cts +2 -2
- package/dist/entity/index.d.ts +3 -3
- package/dist/entity/index.js +5 -5
- package/dist/{errors-BVbjKVMN.cjs → errors-51znTSB1.cjs} +1 -1
- package/dist/{errors-LTe7bOYS.js → errors-CwPJ16bn.js} +2 -2
- package/dist/errors-CwPJ16bn.js.map +1 -0
- package/dist/{expiry-BjpxZZQU.js → expiry-CZErShX6.js} +2 -2
- package/dist/expiry-CZErShX6.js.map +1 -0
- package/dist/expiry-DRV29F1r.d.cts.map +1 -1
- package/dist/expiry-nDbCgZX4.d.ts.map +1 -1
- package/dist/{expiry-BELY2Kpw.cjs → expiry-xr6mx4f7.cjs} +1 -1
- package/dist/{flags-kr276q6i.cjs → flags-Bh0HJldY.cjs} +1 -1
- package/dist/{flags-DFBs2J94.js → flags-Cr76ldwF.js} +2 -2
- package/dist/{flags-DFBs2J94.js.map → flags-Cr76ldwF.js.map} +1 -1
- package/dist/{index-BF7Mq9Is.d.cts → index-CMeD8uEq.d.cts} +4 -4
- package/dist/{index-BF7Mq9Is.d.cts.map → index-CMeD8uEq.d.cts.map} +1 -1
- package/dist/{index-B5j76711.d.ts → index-CTDI5pXZ.d.ts} +5 -5
- package/dist/{index-B5j76711.d.ts.map → index-CTDI5pXZ.d.ts.map} +1 -1
- package/dist/{index-EeUO0nnJ.d.cts → index-CekGjkRx.d.cts} +5 -5
- package/dist/{index-EeUO0nnJ.d.cts.map → index-CekGjkRx.d.cts.map} +1 -1
- package/dist/{index-DvYvrkdk.d.ts → index-D0IzFwMX.d.ts} +12 -4
- package/dist/index-D0IzFwMX.d.ts.map +1 -0
- package/dist/{index-fX_XyqLp.d.ts → index-DZxwz2Ky.d.cts} +53 -43
- package/dist/index-DZxwz2Ky.d.cts.map +1 -0
- package/dist/{index-DHDud2hC.d.ts → index-Dz4SkQWg.d.ts} +4 -4
- package/dist/{index-DHDud2hC.d.ts.map → index-Dz4SkQWg.d.ts.map} +1 -1
- package/dist/{index-CA4V7Pdh.d.cts → index-JP31fjyM.d.ts} +53 -43
- package/dist/index-JP31fjyM.d.ts.map +1 -0
- package/dist/{index-CV5zCdpa.d.cts → index-NbfnXxgr.d.cts} +13 -6
- package/dist/index-NbfnXxgr.d.cts.map +1 -0
- package/dist/index.cjs +41 -42
- package/dist/index.d.cts +58 -52
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +59 -53
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -43
- package/dist/index.js.map +1 -1
- package/dist/{key-WKhXnXuU.cjs → key-E7mv0BYf.cjs} +23 -5
- package/dist/{key-D1Bh7MF0.js → key-XQkpw2xh.js} +17 -5
- package/dist/key-XQkpw2xh.js.map +1 -0
- package/dist/{payload-KC14SDlN.cjs → payload-Cvrir3Q-.cjs} +27 -2
- package/dist/{payload-CcUj85ys.d.ts → payload-D53ms-Mg.d.ts} +60 -1
- package/dist/payload-D53ms-Mg.d.ts.map +1 -0
- package/dist/{payload-Bz6651ax.js → payload-DaPzUvEh.js} +28 -3
- package/dist/payload-DaPzUvEh.js.map +1 -0
- package/dist/{payload-BNoud2KZ.d.cts → payload-hluX1rc0.d.cts} +60 -1
- package/dist/payload-hluX1rc0.d.cts.map +1 -0
- package/dist/query/index.cjs +4 -4
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +4 -4
- package/dist/query/index.js +4 -4
- package/dist/{queryBuilder-DbUMEZln.cjs → queryBuilder-BXR-HxD9.cjs} +13 -10
- package/dist/{queryBuilder-DM6AWCBa.js → queryBuilder-BwauPaGO.js} +14 -11
- package/dist/queryBuilder-BwauPaGO.js.map +1 -0
- package/dist/{selection-DPg0uyJf.d.cts → selection-C6KeWJ7g.d.cts} +16 -8
- package/dist/selection-C6KeWJ7g.d.cts.map +1 -0
- package/dist/{selection-C4UhsMOO.d.ts → selection-mjiiAGDO.d.ts} +17 -9
- package/dist/selection-mjiiAGDO.d.ts.map +1 -0
- package/dist/types/index.d.cts +5 -5
- package/dist/types/index.d.ts +6 -6
- 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/advanced/index.ts +1 -1
- package/src/actions/advanced/sendMutation.ts +1 -1
- 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/arkivAdvanced.ts +1 -1
- 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/advanced-8ZPTmmaN.js.map +0 -1
- 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.map +0 -1
- package/dist/errors-LTe7bOYS.js.map +0 -1
- package/dist/expiry-BjpxZZQU.js.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-fX_XyqLp.d.ts.map +0 -1
- package/dist/key-D1Bh7MF0.js.map +0 -1
- 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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
require('../../expiry-
|
|
2
|
-
const require_advanced = require('../../advanced-
|
|
3
|
-
require('../../attributes-
|
|
4
|
-
require('../../key-
|
|
5
|
-
require('../../errors-
|
|
6
|
-
require('../../flags-
|
|
1
|
+
require('../../expiry-xr6mx4f7.cjs');
|
|
2
|
+
const require_advanced = require('../../advanced-Ds2XRflQ.cjs');
|
|
3
|
+
require('../../attributes-CMJlp1wn.cjs');
|
|
4
|
+
require('../../key-E7mv0BYf.cjs');
|
|
5
|
+
require('../../errors-51znTSB1.cjs');
|
|
6
|
+
require('../../flags-Bh0HJldY.cjs');
|
|
7
7
|
require('../../logger-Cr15lPAQ.cjs');
|
|
8
8
|
|
|
9
9
|
exports.buildMutation = require_advanced.buildMutation;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "../../selection-
|
|
2
|
-
import "../../index-
|
|
1
|
+
import "../../selection-C6KeWJ7g.cjs";
|
|
2
|
+
import "../../index-NbfnXxgr.cjs";
|
|
3
3
|
import "../../expiry-DRV29F1r.cjs";
|
|
4
|
-
import "../../index-
|
|
5
|
-
import "../../arkivTransactions-
|
|
4
|
+
import "../../index-DZxwz2Ky.cjs";
|
|
5
|
+
import "../../arkivTransactions-BpARZOsH.cjs";
|
|
6
6
|
import "../../flags-CRjPpoh3.cjs";
|
|
7
|
-
import { a as pingTransaction, c as decodeMutationResult, d as BuildMutationReturnType, f as buildMutation, i as PingTransactionReturnType, l as getMutationResult, n as SendMutationReturnType, o as GetMutationResultReturnType, r as sendMutation, s as MutationResult, t as SendMutationOptions, u as BuildMutationOptions } from "../../index-
|
|
7
|
+
import { a as pingTransaction, c as decodeMutationResult, d as BuildMutationReturnType, f as buildMutation, i as PingTransactionReturnType, l as getMutationResult, n as SendMutationReturnType, o as GetMutationResultReturnType, r as sendMutation, s as MutationResult, t as SendMutationOptions, u as BuildMutationOptions } from "../../index-CekGjkRx.cjs";
|
|
8
8
|
export { BuildMutationOptions, BuildMutationReturnType, GetMutationResultReturnType, MutationResult, PingTransactionReturnType, SendMutationOptions, SendMutationReturnType, buildMutation, decodeMutationResult, getMutationResult, pingTransaction, sendMutation };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../selection-
|
|
2
|
-
import "../../codec-
|
|
1
|
+
import "../../selection-mjiiAGDO.js";
|
|
2
|
+
import "../../codec-M74UR1_0.js";
|
|
3
3
|
import "../../expiry-nDbCgZX4.js";
|
|
4
|
-
import "../../index-
|
|
5
|
-
import "../../arkivTransactions-
|
|
6
|
-
import "../../index-
|
|
4
|
+
import "../../index-JP31fjyM.js";
|
|
5
|
+
import "../../arkivTransactions-DfZ_yVDD.js";
|
|
6
|
+
import "../../index-D0IzFwMX.js";
|
|
7
7
|
import "../../flags-5dTNRnow.js";
|
|
8
|
-
import { a as pingTransaction, c as decodeMutationResult, d as BuildMutationReturnType, f as buildMutation, i as PingTransactionReturnType, l as getMutationResult, n as SendMutationReturnType, o as GetMutationResultReturnType, r as sendMutation, s as MutationResult, t as SendMutationOptions, u as BuildMutationOptions } from "../../index-
|
|
8
|
+
import { a as pingTransaction, c as decodeMutationResult, d as BuildMutationReturnType, f as buildMutation, i as PingTransactionReturnType, l as getMutationResult, n as SendMutationReturnType, o as GetMutationResultReturnType, r as sendMutation, s as MutationResult, t as SendMutationOptions, u as BuildMutationOptions } from "../../index-CTDI5pXZ.js";
|
|
9
9
|
export { BuildMutationOptions, BuildMutationReturnType, GetMutationResultReturnType, MutationResult, PingTransactionReturnType, SendMutationOptions, SendMutationReturnType, buildMutation, decodeMutationResult, getMutationResult, pingTransaction, sendMutation };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "../../expiry-
|
|
2
|
-
import { a as buildMutation, i as getMutationResult, n as pingTransaction, r as decodeMutationResult, t as sendMutation } from "../../advanced-
|
|
3
|
-
import "../../attributes-
|
|
4
|
-
import "../../key-
|
|
5
|
-
import "../../errors-
|
|
6
|
-
import "../../flags-
|
|
1
|
+
import "../../expiry-CZErShX6.js";
|
|
2
|
+
import { a as buildMutation, i as getMutationResult, n as pingTransaction, r as decodeMutationResult, t as sendMutation } from "../../advanced-FZy7WoYR.js";
|
|
3
|
+
import "../../attributes-BJGuhsqp.js";
|
|
4
|
+
import "../../key-XQkpw2xh.js";
|
|
5
|
+
import "../../errors-CwPJ16bn.js";
|
|
6
|
+
import "../../flags-Cr76ldwF.js";
|
|
7
7
|
import "../../logger-CVpvU8ik.js";
|
|
8
8
|
|
|
9
9
|
export { buildMutation, decodeMutationResult, getMutationResult, pingTransaction, sendMutation };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_expiry = require('./expiry-
|
|
2
|
-
const require_attributes = require('./attributes-
|
|
3
|
-
const require_key = require('./key-
|
|
4
|
-
const require_flags = require('./flags-
|
|
1
|
+
const require_expiry = require('./expiry-xr6mx4f7.cjs');
|
|
2
|
+
const require_attributes = require('./attributes-CMJlp1wn.cjs');
|
|
3
|
+
const require_key = require('./key-E7mv0BYf.cjs');
|
|
4
|
+
const require_flags = require('./flags-Bh0HJldY.cjs');
|
|
5
5
|
const require_logger = require('./logger-Cr15lPAQ.cjs');
|
|
6
6
|
let viem = require("viem");
|
|
7
7
|
|
|
@@ -310,7 +310,7 @@ function buildEntityOperations(ops, context) {
|
|
|
310
310
|
const createOps = (creates ?? []).map((item) => {
|
|
311
311
|
validateContentType(item.contentType);
|
|
312
312
|
return createOperation({
|
|
313
|
-
salt: item.salt === void 0 ? require_key.randomSalt() : require_key.
|
|
313
|
+
salt: item.salt === void 0 ? require_key.randomSalt() : require_key.resolveSalt(item.salt),
|
|
314
314
|
expiry: require_expiry.resolveExpiry(item.expires, context),
|
|
315
315
|
creationFlags: require_flags.encodeCreationFlags(item.flags),
|
|
316
316
|
attributes: require_attributes.encodeAttributes(item.attributes, {
|
|
@@ -571,7 +571,7 @@ const logger = require_logger.getLogger("actions:advanced:send-mutation");
|
|
|
571
571
|
/**
|
|
572
572
|
* Signs and sends a mutation batch, returning as soon as the transaction is submitted.
|
|
573
573
|
*
|
|
574
|
-
* The fire-and-forget half of the advanced path. Unlike `
|
|
574
|
+
* The fire-and-forget half of the advanced path. Unlike `executeBatch`, this does **not** wait
|
|
575
575
|
* for a receipt, does not poll, and runs no revert diagnosis — it spends only what submitting
|
|
576
576
|
* costs. With `options.currentBlock` and full `txParams` (nonce, gas, fees) that is exactly one
|
|
577
577
|
* RPC call; each omitted piece adds only the lookup viem needs to fill it.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as OperationType, n as resolveExpiry, o as ARKIV_ADDRESS } from "./expiry-
|
|
2
|
-
import { i as encodeMutations, r as encodeAttributes } from "./attributes-
|
|
3
|
-
import { a as
|
|
4
|
-
import { n as encodeCreationFlags } from "./flags-
|
|
1
|
+
import { a as OperationType, n as resolveExpiry, o as ARKIV_ADDRESS } from "./expiry-CZErShX6.js";
|
|
2
|
+
import { i as encodeMutations, r as encodeAttributes } from "./attributes-BJGuhsqp.js";
|
|
3
|
+
import { a as resolveSalt, i as randomSalt, o as ENTITY_EVENTS_ABI } from "./key-XQkpw2xh.js";
|
|
4
|
+
import { n as encodeCreationFlags } from "./flags-Cr76ldwF.js";
|
|
5
5
|
import { i as InvalidContentTypeError, n as EmptyPatchError, r as EntityMutationError, t as getLogger } from "./logger-CVpvU8ik.js";
|
|
6
6
|
import { BaseError, ContractFunctionExecutionError, ContractFunctionRevertedError, TransactionExecutionError, TransactionReceiptNotFoundError, decodeEventLog, encodeAbiParameters, encodeFunctionData, hexToString, parseAbi, parseAbiParameters } from "viem";
|
|
7
7
|
|
|
@@ -310,7 +310,7 @@ function buildEntityOperations(ops, context) {
|
|
|
310
310
|
const createOps = (creates ?? []).map((item) => {
|
|
311
311
|
validateContentType(item.contentType);
|
|
312
312
|
return createOperation({
|
|
313
|
-
salt: item.salt === void 0 ? randomSalt() :
|
|
313
|
+
salt: item.salt === void 0 ? randomSalt() : resolveSalt(item.salt),
|
|
314
314
|
expiry: resolveExpiry(item.expires, context),
|
|
315
315
|
creationFlags: encodeCreationFlags(item.flags),
|
|
316
316
|
attributes: encodeAttributes(item.attributes, {
|
|
@@ -571,7 +571,7 @@ const logger = getLogger("actions:advanced:send-mutation");
|
|
|
571
571
|
/**
|
|
572
572
|
* Signs and sends a mutation batch, returning as soon as the transaction is submitted.
|
|
573
573
|
*
|
|
574
|
-
* The fire-and-forget half of the advanced path. Unlike `
|
|
574
|
+
* The fire-and-forget half of the advanced path. Unlike `executeBatch`, this does **not** wait
|
|
575
575
|
* for a receipt, does not poll, and runs no revert diagnosis — it spends only what submitting
|
|
576
576
|
* costs. With `options.currentBlock` and full `txParams` (nonce, gas, fees) that is exactly one
|
|
577
577
|
* RPC call; each omitted piece adds only the lookup viem needs to fill it.
|
|
@@ -595,4 +595,4 @@ async function sendMutation(client, data, options = {}) {
|
|
|
595
595
|
|
|
596
596
|
//#endregion
|
|
597
597
|
export { buildMutation as a, mutationNeedsBlockNumber as c, getMutationResult as i, sendArkivTransaction as l, pingTransaction as n, buildEntityOperations as o, decodeMutationResult as r, collectMutationEvents as s, sendMutation as t, ENTITY_NONCE_ABI as u };
|
|
598
|
-
//# sourceMappingURL=advanced-
|
|
598
|
+
//# sourceMappingURL=advanced-FZy7WoYR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"advanced-FZy7WoYR.js","names":["logger","EXECUTE_ABI","EXECUTE_FUNCTION_ABI","operations: Operation[]","events: MutationEvents","logger","logger","logger"],"sources":["../src/entity/operations.ts","../src/utils/revert.ts","../src/utils/arkivTransactions.ts","../src/actions/advanced/buildMutation.ts","../src/actions/advanced/getMutationResult.ts","../src/actions/advanced/pingTransaction.ts","../src/actions/advanced/sendMutation.ts"],"sourcesContent":["import { type Address, encodeAbiParameters, type Hex, parseAbi, parseAbiParameters } from \"viem\"\nimport type { AbiAttribute } from \"../attr/codec\"\nimport type { EncodedExpiry } from \"./expiry\"\nimport type { predictEntityKey } from \"./key\"\nimport { OperationType } from \"./params\"\n\n/**\n * The one external entry point. A transaction is an ordered, **atomic** batch of entity operations:\n * all of them apply or none do, operation *n+1* observes operation *n*'s effects, and each applied\n * operation emits one event.\n */\nexport const EXECUTE_ABI = parseAbi([\n \"function execute((uint8 operation, bytes operationData)[] ops) external returns (bytes32[] keys)\",\n])\n\n/**\n * The engine's one read-only view: an owner's entity-minting nonce, which is the input\n * {@link predictEntityKey} needs and the only part of the derivation the caller cannot know.\n *\n * It is a `view` on the same address `execute` is called on, so it answers over `eth_call` without\n * a transaction.\n */\nexport const ENTITY_NONCE_ABI = parseAbi([\n \"function entityNonce(address owner) external view returns (uint64)\",\n])\n\n/**\n * The shared attribute shape, used by `create` (attributes) and `patch` (mutations). Written out\n * once and reused by every payload that carries attributes.\n */\nconst ATTRIBUTE_TUPLE = \"(bytes32 name, uint8 typeId, bytes value)[]\"\n\n/**\n * The payload struct for each operation tag. `operationData` is `abi.encode` of the struct the tag\n * selects — a tagged union, so a new operation is additive rather than a change to `execute`.\n */\nconst PAYLOAD_PARAMS = {\n [OperationType.Create]: parseAbiParameters(\n `(uint128 salt, uint64 expiresAt, uint64 minLifetime, uint8 creationFlags, ${ATTRIBUTE_TUPLE} attributes)`,\n ),\n [OperationType.Patch]: parseAbiParameters(`(bytes32 entityKey, ${ATTRIBUTE_TUPLE} mutations)`),\n [OperationType.ExtendExpiry]: parseAbiParameters(\n \"(bytes32 entityKey, uint64 expiresAt, uint64 minLifetime)\",\n ),\n [OperationType.TransferOwnership]: parseAbiParameters(\"(bytes32 entityKey, address newOwner)\"),\n [OperationType.Delete]: parseAbiParameters(\"(bytes32 entityKey)\"),\n} as const\n\n/** One entry of the `execute` batch: the operation tag and its ABI-encoded payload. */\nexport type Operation = {\n operation: number\n operationData: Hex\n}\n\n/** Creates an entity. The key is derived by the engine; predict it with `predictEntityKey`. */\nexport function createOperation({\n salt,\n expiry,\n creationFlags,\n attributes,\n}: {\n salt: bigint\n expiry: EncodedExpiry\n creationFlags: number\n attributes: AbiAttribute[]\n}): Operation {\n return {\n operation: OperationType.Create,\n operationData: encodeAbiParameters(PAYLOAD_PARAMS[OperationType.Create], [\n {\n salt,\n expiresAt: expiry.expiresAt,\n minLifetime: expiry.minLifetime,\n creationFlags,\n attributes,\n },\n ]),\n }\n}\n\n/** Applies a set of mutations to an existing entity. Tombstones unset attributes. */\nexport function patchOperation({\n entityKey,\n mutations,\n}: {\n entityKey: Hex\n mutations: AbiAttribute[]\n}): Operation {\n return {\n operation: OperationType.Patch,\n operationData: encodeAbiParameters(PAYLOAD_PARAMS[OperationType.Patch], [\n { entityKey, mutations },\n ]),\n }\n}\n\n/** Pushes an entity's expiry further out. Extending is allowed; shortening reverts. */\nexport function extendExpiryOperation({\n entityKey,\n expiry,\n}: {\n entityKey: Hex\n expiry: EncodedExpiry\n}): Operation {\n return {\n operation: OperationType.ExtendExpiry,\n operationData: encodeAbiParameters(PAYLOAD_PARAMS[OperationType.ExtendExpiry], [\n { entityKey, expiresAt: expiry.expiresAt, minLifetime: expiry.minLifetime },\n ]),\n }\n}\n\n/** Hands an entity to a new owner. */\nexport function transferOwnershipOperation({\n entityKey,\n newOwner,\n}: {\n entityKey: Hex\n newOwner: Address\n}): Operation {\n return {\n operation: OperationType.TransferOwnership,\n operationData: encodeAbiParameters(PAYLOAD_PARAMS[OperationType.TransferOwnership], [\n { entityKey, newOwner },\n ]),\n }\n}\n\n/** Deletes an entity before its expiry. */\nexport function deleteOperation({ entityKey }: { entityKey: Hex }): Operation {\n return {\n operation: OperationType.Delete,\n operationData: encodeAbiParameters(PAYLOAD_PARAMS[OperationType.Delete], [{ entityKey }]),\n }\n}\n","import { BaseError, ContractFunctionRevertedError, type Hex, hexToString } from \"viem\"\n\n/**\n * Turns a decoded engine revert into a sentence that says what to change.\n *\n * viem decodes the error and then renders it positionally — `Ident32InvalidByte(uint256 position,\n * bytes1 value)` arrives as `(5, 0x41)`, which is the right data and no help at all. The engine's\n * errors carry enough to name the actual problem, so this spends the args rather than printing\n * them.\n *\n * @param error - Anything thrown by a write action.\n * @returns The explanation, or `undefined` if this was not a decodable engine revert — in which\n * case the caller should fall back to whatever the transport said.\n */\nexport function describeEntityRevert(error: unknown): string | undefined {\n if (!(error instanceof BaseError)) return undefined\n const reverted = error.walk((e) => e instanceof ContractFunctionRevertedError)\n if (!(reverted instanceof ContractFunctionRevertedError)) return undefined\n\n const name = reverted.data?.errorName\n if (name === undefined) return undefined\n const args = (reverted.data?.args ?? []) as readonly unknown[]\n\n return explain(name, args) ?? `the engine rejected the batch with ${name}`\n}\n\n/** The attribute-name charset, quoted the way an error message should read. */\nconst CHARSET = '\"A\"-\"Z\", \"a\"-\"z\", \"0\"-\"9\", \".\", \"-\" and \"_\", with a letter first'\n\nfunction explain(name: string, args: readonly unknown[]): string | undefined {\n switch (name) {\n // ── attribute names ──────────────────────────────────────────────────────\n case \"Ident32InvalidByte\": {\n const position = Number(args[0] ?? 0)\n const char = printable(String(args[1] ?? \"0x00\"))\n return (\n `an attribute name holds ${char} at byte ${position}, which is outside the ` +\n `name charset (${CHARSET})`\n )\n }\n case \"Ident32Empty\":\n return \"an attribute name is empty\"\n\n // ── the attribute list ───────────────────────────────────────────────────\n case \"SystemAttributeNotWritable\":\n return (\n `\"${identName(args[0])}\" is owned by the engine and cannot be written. Only $payload and ` +\n \"$contentType are yours to set\"\n )\n case \"TombstoneInCreate\":\n return (\n `a create cannot unset \"${identName(args[0])}\" — nothing exists yet, so leave the name ` +\n \"out instead\"\n )\n case \"TombstoneValueNotEmpty\":\n return `the tombstone for \"${identName(args[0])}\" carries a value; unsetting takes no value`\n case \"InvalidValueType\":\n return `\"${identName(args[0])}\" names type id ${String(args[1])}, which is not a known type`\n case \"AttributesNotSorted\":\n return \"attributes must be strictly ascending by name, which also makes each name unique\"\n case \"TooManyAttributes\":\n return `${String(args[0])} attributes exceeds the limit of ${String(args[1])}`\n case \"EmptyMutations\":\n return `the patch of ${short(args[0])} has no mutations, so it would do nothing`\n\n // ── entity state and authorisation ───────────────────────────────────────\n case \"EntityNotFound\":\n return `no entity ${short(args[0])} — it may have been deleted, or have expired`\n case \"EntityExpired\":\n return `entity ${short(args[0])} expired at block ${String(args[1])}`\n case \"NotOwner\":\n return `entity ${short(args[0])} is owned by ${String(args[2])}, not ${String(args[1])}`\n case \"ReadOnlyEntity\":\n return (\n `entity ${short(args[0])} was created readonly, so its contents can never change. Its ` +\n \"expiry can still be extended, and it can be transferred or deleted\"\n )\n case \"ReservedCreationFlags\":\n return (\n `creation flags 0b${Number(args[0] ?? 0)\n .toString(2)\n .padStart(8, \"0\")} set a reserved ` +\n \"bit; only readonly and permissionlessExtension are defined\"\n )\n\n // ── expiry ───────────────────────────────────────────────────────────────\n case \"ExpiryDeadOnArrival\":\n return (\n `the expiry resolves to block ${String(args[0])}, which is not after the current block ` +\n `${String(args[1])}`\n )\n case \"ExpiryNotExtended\":\n return (\n `entity ${short(args[0])} already expires at block ${String(args[2])}, so extending it ` +\n `to ${String(args[1])} would shorten its life`\n )\n\n // ── ownership ────────────────────────────────────────────────────────────\n case \"TransferToZeroAddress\":\n return `entity ${short(args[0])} cannot be transferred to the zero address`\n case \"TransferToSelf\":\n return `entity ${short(args[0])} is already owned by that account`\n\n // ── batch framing ────────────────────────────────────────────────────────\n case \"EmptyBatch\":\n return \"the batch has no operations\"\n case \"InvalidOpType\":\n return `operation tag ${String(args[0])} is not one the engine knows`\n case \"NonCanonicalOperationData\":\n return (\n `the payload for operation tag ${String(args[0])} is not its canonical encoding, so the ` +\n \"engine refused it rather than accept a second spelling of the same operation\"\n )\n\n default:\n return undefined\n }\n}\n\n/** A `bytes32` Ident32 cell as the name it holds — left-aligned, null-padded. */\nfunction identName(raw: unknown): string {\n if (typeof raw !== \"string\") return String(raw)\n try {\n // Cut at the first null rather than trimming with a regex: the padding is whatever follows\n // the name, so everything before it is the name and nothing after it is. Written as an escape\n // because a literal NUL byte in source is invisible to every reader after you.\n return hexToString(raw as Hex).split(\"\\u0000\")[0] ?? \"\"\n } catch {\n return raw\n }\n}\n\n/** An entity key, abbreviated */\nfunction short(raw: unknown): string {\n const text = String(raw)\n return text.length > 18 ? `${text.slice(0, 10)}…${text.slice(-6)}` : text\n}\n\n/** A `bytes1` as something readable: the character it is, plus the byte it was. */\nfunction printable(byte: string): string {\n const code = Number.parseInt(byte.replace(/^0x/, \"\"), 16)\n if (!Number.isFinite(code)) return `byte ${byte}`\n const char = String.fromCharCode(code)\n return code >= 0x21 && code <= 0x7e ? `\"${char}\" (${byte})` : `byte ${byte}`\n}\n","import {\n type Address,\n ContractFunctionExecutionError,\n ContractFunctionRevertedError,\n decodeEventLog,\n type Hash,\n type Hex,\n parseAbi,\n TransactionExecutionError,\n type TransactionReceipt,\n} from \"viem\"\nimport type { ChangeOwnershipParameters } from \"../actions/wallet/changeOwnership\"\nimport type { CreateEntityParameters } from \"../actions/wallet/createEntity\"\nimport type { DeleteEntityParameters } from \"../actions/wallet/deleteEntity\"\nimport type { ExtendEntityParameters } from \"../actions/wallet/extendEntity\"\nimport type { PatchEntityParameters } from \"../actions/wallet/patchEntity\"\n// Internal seam: the ABI encoders are not part of the package's public surface.\nimport { encodeAttributes, encodeMutations } from \"../attr/attributes\"\nimport type { ArkivClient } from \"../clients/baseClient\"\nimport type { WalletArkivClient } from \"../clients/createWalletClient\"\nimport { ARKIV_ADDRESS } from \"../consts\"\nimport { ENTITY_EVENTS_ABI } from \"../entity/events\"\nimport { type Expiry, type ExpiryContext, resolveExpiry } from \"../entity/expiry\"\nimport { encodeCreationFlags } from \"../entity/flags\"\nimport { randomSalt, resolveSalt } from \"../entity/key\"\nimport {\n createOperation,\n deleteOperation,\n EXECUTE_ABI as EXECUTE_FUNCTION_ABI,\n extendExpiryOperation,\n type Operation,\n patchOperation,\n transferOwnershipOperation,\n} from \"../entity/operations\"\nimport { EmptyPatchError, EntityMutationError, InvalidContentTypeError } from \"../errors\"\nimport type { TxParams } from \"../types\"\n\nimport { getLogger } from \"./logger\"\nimport { describeEntityRevert } from \"./revert\"\n\nconst logger = getLogger(\"utils:arkiv-transactions\")\n\n// RFC 2045 token chars, lowercase only. Rejects uppercase to prevent text/plain vs Text/Plain ambiguity.\nconst MIME_REGEX = /^[a-z][a-z0-9!#$&\\-^_]*\\/[a-z0-9][a-z0-9!#$&\\-^_.+]*$/\n\nfunction validateContentType(contentType: string): void {\n if (!MIME_REGEX.test(contentType)) {\n throw new InvalidContentTypeError(contentType)\n }\n}\n\nexport const ENTITY_ERRORS_ABI = parseAbi([\n // Batch and operation framing.\n \"error EmptyBatch()\",\n \"error InvalidOpType(uint8 operation)\",\n \"error NonCanonicalOperationData(uint8 operation)\",\n // The attribute triple list, structural.\n \"error AttributesNotSorted()\",\n \"error TooManyAttributes(uint256 count, uint256 maxCount)\",\n \"error EmptyMutations(bytes32 entityKey)\",\n \"error TombstoneInCreate(bytes32 name)\",\n \"error TombstoneValueNotEmpty(bytes32 name)\",\n \"error SystemAttributeNotWritable(bytes32 name)\",\n \"error InvalidValueType(bytes32 name, uint8 typeId)\",\n // Attribute-name validation. `Ident32` is a bytes32 on the wire.\n \"error Ident32Empty()\",\n \"error Ident32InvalidByte(uint256 position, bytes1 value)\",\n // Entity state and authorisation.\n \"error EntityNotFound(bytes32 entityKey)\",\n \"error EntityExpired(bytes32 entityKey, uint64 expiresAt)\",\n \"error NotOwner(bytes32 entityKey, address caller, address owner)\",\n \"error ReadOnlyEntity(bytes32 entityKey)\",\n \"error ReservedCreationFlags(uint8 creationFlags)\",\n // Expiry. The engine bounds an expiry only by the width of the field and by liveness — there is\n // no MAX_EXPIRES_AT or MAX_LIFETIME, so there is no error for exceeding one.\n \"error ExpiryDeadOnArrival(uint64 target, uint64 currentBlock)\",\n \"error ExpiryNotExtended(bytes32 entityKey, uint64 newExpiresAt, uint64 currentExpiresAt)\",\n // Ownership transfer.\n \"error TransferToZeroAddress(bytes32 entityKey)\",\n \"error TransferToSelf(bytes32 entityKey)\",\n])\n\nconst EXECUTE_ABI = [...EXECUTE_FUNCTION_ABI, ...ENTITY_ERRORS_ABI]\n\nexport type SendArkivTransactionResult = {\n receipt: TransactionReceipt\n /** The keys the engine minted for the entities this transaction created, in batch order. */\n createdEntityKeys: Hex[]\n /** The block each created entity expires at, as the engine recorded it, in the same order. */\n createdExpiries: bigint[]\n /** The block each extended entity now expires at, as the engine recorded it, in batch order. */\n extendedExpiries: bigint[]\n}\n\nexport async function sendArkivTransaction(\n client: ArkivClient,\n ops: EntityMutationOps,\n txParams?: TxParams,\n): Promise<SendArkivTransactionResult> {\n if (!client.account) throw new Error(\"Account required\")\n if (!client.chain) throw new Error(\"Chain required\")\n const walletClient = client as WalletArkivClient\n\n const { creates, extensions } = ops\n\n // The block height, to resolve any relative expiry — which both creates and extensions carry.\n // Skipped entirely for a batch with neither. Deliberately fetched even when every expiry is\n // absolute (where `mutationNeedsBlockNumber` would say no): the head is what makes the local\n // dead-on-arrival check in `resolveExpiry` work, and the everyday path buys that check — the\n // advanced path is where both are traded away for the saved call.\n const currentBlock =\n creates?.length || extensions?.length ? await walletClient.getBlockNumber() : 0n\n\n const operations = buildEntityOperations(ops, { currentBlock })\n\n logger(\"Sending execute with %d operations %o\", operations.length, operations)\n\n const txHash = await submitMutation(client, operations, txParams)\n\n try {\n const receipt = await walletClient.waitForTransactionReceipt({ hash: txHash })\n logger(\"Tx receipt %o\", receipt)\n\n if (receipt.status === \"reverted\") {\n try {\n await walletClient.simulateContract({\n address: ARKIV_ADDRESS,\n abi: EXECUTE_ABI,\n functionName: \"execute\",\n args: [operations],\n account: client.account,\n chain: client.chain,\n })\n } catch (err) {\n const error = err as { shortMessage?: string; cause?: { details?: string } }\n const reason =\n describeEntityRevert(err) ??\n error.shortMessage ??\n error.cause?.details ??\n \"No reason provided by backend.\"\n throw new EntityMutationError(\n `Transaction ${receipt.transactionHash} reverted. Reason: ${reason}`,\n )\n }\n throw new EntityMutationError(\n `Transaction ${receipt.transactionHash} reverted. No reason provided by backend.`,\n )\n }\n\n return {\n receipt,\n ...readAppliedOperations(receipt, {\n creates: creates?.length ?? 0,\n extensions: extensions?.length ?? 0,\n }),\n }\n } catch (error) {\n throw asEntityMutationError(error)\n }\n}\n\n/**\n * Wraps whatever a write step threw into an {@link EntityMutationError} — engine terms when the\n * revert data decodes, the node's own message otherwise. An {@link EntityMutationError} passes\n * through unchanged, so wrapped steps compose without double-wrapping.\n */\nfunction asEntityMutationError(error: unknown): EntityMutationError {\n if (error instanceof EntityMutationError) return error\n\n const described = describeEntityRevert(error)\n if (described !== undefined) {\n return new EntityMutationError(`Transaction failed: ${described}`, { cause: error })\n }\n\n let message = \"Transaction failed\"\n if (error instanceof TransactionExecutionError) {\n message += `: ${error.details}`\n } else if (error instanceof ContractFunctionExecutionError) {\n logger(\"Contract function execution error data:\", error.shortMessage)\n if (error.cause instanceof ContractFunctionRevertedError) {\n message += `: ${error.cause.message}`\n } else {\n message += \": Execution error without revert data\"\n }\n } else if (error instanceof Error) {\n message += `: ${error.message}`\n }\n\n return new EntityMutationError(message, { cause: error })\n}\n\n/**\n * The keys and expiries the engine recorded, read back from the events the batch emitted.\n */\nfunction readAppliedOperations(\n receipt: TransactionReceipt,\n expected: { creates: number; extensions: number },\n): Omit<SendArkivTransactionResult, \"receipt\"> {\n const events = collectMutationEvents(receipt.logs)\n\n const createdEntityKeys = events.created.map((e) => e.entityKey)\n const createdExpiries = events.created.map((e) => e.expiresAt)\n const extendedExpiries = events.extended.map((e) => e.expiresAt)\n\n // Operations apply in batch order and emit one event each, and creates lead the batch — so these\n // arrive already aligned with the parameters they came from. A count that disagrees means that\n // assumption broke, and a misaligned array would hand back a key belonging to another entity.\n assertCount(receipt, \"create\", createdEntityKeys.length, expected.creates)\n assertCount(receipt, \"extension\", extendedExpiries.length, expected.extensions)\n\n return { createdEntityKeys, createdExpiries, extendedExpiries }\n}\n\n/** One log as an entity event, or `undefined` for anything this SDK has no name for. */\nfunction decodeEntityLog(log: TransactionReceipt[\"logs\"][number]) {\n try {\n return decodeEventLog({ abi: ENTITY_EVENTS_ABI, topics: log.topics, data: log.data })\n } catch {\n // An event a newer engine emits and this ABI does not describe. Not this function's business.\n return undefined\n }\n}\n\nfunction assertCount(receipt: TransactionReceipt, what: string, got: number, want: number): void {\n if (got === want) return\n // Deliberately explicit that the write succeeded: this throws *after* a successful transaction,\n // and a caller who reads it as a failure and retries would create the entities a second time.\n throw new EntityMutationError(\n `Transaction ${receipt.transactionHash} succeeded — do not retry it — but emitted ${got} ` +\n `${what} event(s) for ${want} ${what} operation(s). The batch was applied; the SDK cannot ` +\n `say which entity each operation produced, so read them back to find them.`,\n )\n}\n\n// ─────────────────────────────────────────────────────────────────────────────────────────────────\n// The seams the advanced path is built on.\n//\n// `sendArkivTransaction` above is the everyday path: encode, send, wait, decode, diagnose. These\n// are the same steps as separate pieces, so `actions/advanced` can spend exactly the RPC calls a\n// caller asks for and no more — without a second copy of the encoding or the event decoding.\n// ─────────────────────────────────────────────────────────────────────────────────────────────────\n\n/** The five kinds of entity operation one Arkiv transaction can batch. */\nexport type EntityMutationOps = {\n /** The entities to create. */\n creates?: CreateEntityParameters[]\n /** The patches to apply. */\n patches?: PatchEntityParameters[]\n /** The entities to delete. */\n deletes?: DeleteEntityParameters[]\n /** The expiries to set. */\n extensions?: ExtendEntityParameters[]\n /** The ownership transfers to perform. */\n ownershipChanges?: ChangeOwnershipParameters[]\n}\n\n/**\n * Whether encoding the batch actually requires the chain head.\n *\n * Only a relative lifetime (`minLifetime > 0`) or a wall-clock deadline (a `Date`) is measured\n * from the current block. A purely absolute `atBlock(n)` expiry encodes the same bytes whatever\n * the head is, so a batch of those — or one with no expiries at all — needs no `eth_blockNumber`.\n */\nexport function mutationNeedsBlockNumber(ops: EntityMutationOps): boolean {\n return [...(ops.creates ?? []), ...(ops.extensions ?? [])].some((item) => {\n const expires = item.expires as Expiry | undefined\n // Malformed expiries are rejected by buildEntityOperations without needing the head.\n if (expires === undefined || typeof expires.minLifetime !== \"bigint\") return false\n return expires.minLifetime !== 0n || expires.expiresAt instanceof Date\n })\n}\n\n/**\n * Encodes a batch into the `execute` operations, in the order the engine applies them: creates,\n * patches, deletes, extensions, ownership transfers.\n *\n * Pure — every check here is local (content types, salts, expiry bounds, non-empty patches and a\n * non-empty batch), so the only chain input is `context.currentBlock`. Callers that carry no\n * relative expiry (see {@link mutationNeedsBlockNumber}) can pass `0n`, which disables the\n * dead-on-arrival pre-check and leaves that to the engine.\n */\nexport function buildEntityOperations(ops: EntityMutationOps, context: ExpiryContext): Operation[] {\n const { creates, patches, deletes, extensions, ownershipChanges } = ops\n\n const createOps = (creates ?? []).map((item) => {\n validateContentType(item.contentType)\n\n const salt = item.salt === undefined ? randomSalt() : resolveSalt(item.salt)\n const expiry = resolveExpiry(item.expires, context)\n\n return createOperation({\n salt,\n expiry,\n creationFlags: encodeCreationFlags(item.flags),\n attributes: encodeAttributes(item.attributes, {\n payload: item.payload,\n contentType: item.contentType,\n }),\n })\n })\n\n const patchOps = (patches ?? []).map((item) => {\n if (item.contentType !== undefined) validateContentType(item.contentType)\n const mutations = encodeMutations(item)\n if (mutations.length === 0) {\n throw new EmptyPatchError(item.entityKey)\n }\n return patchOperation({ entityKey: item.entityKey, mutations })\n })\n\n // An extension resolves its expiry exactly as a create does — the engine applies the same\n // `max(expiresAt, currentBlock + minLifetime)` to both — so the same bounds are checked here\n // rather than left to a revert.\n const extendOps = (extensions ?? []).map((item) => {\n const expiry = resolveExpiry(item.expires, context)\n return extendExpiryOperation({ entityKey: item.entityKey, expiry })\n })\n\n const operations: Operation[] = [\n ...createOps,\n ...patchOps,\n ...(deletes ?? []).map((item) => deleteOperation({ entityKey: item.entityKey })),\n ...extendOps,\n ...(ownershipChanges ?? []).map((item) =>\n transferOwnershipOperation({\n entityKey: item.entityKey,\n newOwner: item.newOwner as Address,\n }),\n ),\n ]\n\n if (operations.length === 0) {\n throw new Error(\"No operations to perform\")\n }\n\n return operations\n}\n\n/**\n * Signs and sends an encoded batch, wrapping any node rejection in {@link EntityMutationError}.\n *\n * The submission half both write paths share: one `writeContract` — an `eth_sendRawTransaction`,\n * plus only the lookups viem needs for whatever `txParams` leaves out — with no waiting and no\n * polling. A rejection is reported in engine terms when the node returned decodable revert data,\n * and with the node's own message otherwise; either way the caller sees an\n * {@link EntityMutationError}.\n *\n * Internal seam shared with `actions/advanced/sendMutation`; not part of the package's public\n * surface.\n */\nexport async function submitMutation(\n client: ArkivClient,\n operations: Operation[],\n txParams?: TxParams,\n): Promise<Hash> {\n if (!client.account) throw new Error(\"Account required\")\n if (!client.chain) throw new Error(\"Chain required\")\n const walletClient = client as WalletArkivClient\n\n try {\n return await walletClient.writeContract({\n address: ARKIV_ADDRESS,\n abi: EXECUTE_ABI,\n functionName: \"execute\",\n args: [operations],\n account: client.account,\n chain: client.chain,\n ...txParams,\n })\n } catch (error) {\n throw asEntityMutationError(error)\n }\n}\n\n/** Everything the batch's events say happened, one entry per applied operation, per kind. */\nexport type MutationEvents = {\n created: { entityKey: Hex; owner: Address; expiresAt: bigint }[]\n patched: { entityKey: Hex; owner: Address }[]\n deleted: { entityKey: Hex; owner: Address }[]\n extended: { entityKey: Hex; owner: Address; expiresAt: bigint }[]\n ownershipTransferred: { entityKey: Hex; previousOwner: Address; newOwner: Address }[]\n}\n\n/**\n * Reads the entity events out of a receipt's logs, exactly as they were emitted.\n *\n * Lenient by design: it reports what the events say and nothing else — no counting against what\n * was asked for (the caller may not have the request at hand) and no error for a receipt with no\n * entity events at all. Logs from other contracts and events this SDK has no name for are skipped.\n */\nexport function collectMutationEvents(logs: TransactionReceipt[\"logs\"]): MutationEvents {\n const events: MutationEvents = {\n created: [],\n patched: [],\n deleted: [],\n extended: [],\n ownershipTransferred: [],\n }\n\n // `?? []` so a receipt without logs decodes to \"nothing happened\" rather than a TypeError.\n for (const log of logs ?? []) {\n // Only the operation address emits these, and a batch's transaction can carry logs from\n // anything else it touched.\n if (log.address.toLowerCase() !== ARKIV_ADDRESS.toLowerCase()) continue\n const decoded = decodeEntityLog(log)\n if (decoded === undefined) continue\n\n switch (decoded.eventName) {\n case \"EntityCreated\":\n events.created.push({\n entityKey: decoded.args.entityKey,\n owner: decoded.args.owner,\n expiresAt: decoded.args.expiresAt,\n })\n break\n case \"EntityPatched\":\n events.patched.push({ entityKey: decoded.args.entityKey, owner: decoded.args.owner })\n break\n case \"EntityDeleted\":\n events.deleted.push({ entityKey: decoded.args.entityKey, owner: decoded.args.owner })\n break\n case \"ExpiryExtended\":\n events.extended.push({\n entityKey: decoded.args.entityKey,\n owner: decoded.args.owner,\n expiresAt: decoded.args.expiresAt,\n })\n break\n case \"OwnershipTransferred\":\n events.ownershipTransferred.push({\n entityKey: decoded.args.entityKey,\n previousOwner: decoded.args.previousOwner,\n newOwner: decoded.args.newOwner,\n })\n break\n }\n }\n\n return events\n}\n","import { type Address, encodeFunctionData, type Hex } from \"viem\"\nimport type { ArkivClient } from \"../../clients/baseClient\"\nimport type { PublicArkivClient } from \"../../clients/createPublicClient\"\nimport { ARKIV_ADDRESS } from \"../../consts\"\nimport { EXECUTE_ABI, type Operation } from \"../../entity/operations\"\nimport {\n buildEntityOperations,\n type EntityMutationOps,\n mutationNeedsBlockNumber,\n} from \"../../utils/arkivTransactions\"\nimport { getLogger } from \"../../utils/logger\"\n\nconst logger = getLogger(\"actions:advanced:build-mutation\")\n\n/** Options for the advanced-path builders ({@link buildMutation}, {@link sendMutation}). */\nexport type BuildMutationOptions = {\n /**\n * The chain head to resolve relative expiries against.\n *\n * Pass a block number you already hold — from a previous call, `getBlockTiming()`, or your own\n * tracking — and the build spends no RPC call at all. Without it, one `eth_blockNumber` is made,\n * and only when the batch actually needs the head (a relative lifetime or a `Date` deadline);\n * purely absolute `atBlock(n)` expiries never trigger it.\n *\n * Supplying it also buys back a check: absolute expiries are validated against it, so an\n * `atBlock(n)` already in the past throws {@link InvalidExpiryError} locally instead of\n * reverting on-chain. When the head is neither supplied nor fetched, that dead-on-arrival\n * check is skipped — the one local validation of the everyday path this path trades away.\n */\n currentBlock?: bigint\n}\n\n/** What {@link buildMutation} hands back: the batch in every form a sender might want. */\nexport type BuildMutationReturnType = {\n /** The encoded batch, in engine order, for `writeContract`-style sends. */\n operations: Operation[]\n /** The Arkiv engine address the transaction must be sent to. */\n to: Address\n /**\n * The full `execute(operations)` calldata. Sign a transaction carrying it offline (with your own\n * nonce, gas and fees) and the whole mutation costs exactly one `eth_sendRawTransaction`.\n */\n data: Hex\n /**\n * How many operations of each kind went into the batch — which is how many events of each kind a\n * successful transaction emits, in batch order, for cross-checking a decoded result.\n */\n expected: {\n creates: number\n patches: number\n deletes: number\n extensions: number\n ownershipChanges: number\n }\n}\n\n/**\n * Encodes a mutation batch without sending anything.\n *\n * This is the first step of the advanced path: it performs only local validation and encoding, so\n * it costs **zero RPC calls** when `options.currentBlock` is provided (or no expiry is relative),\n * and at most one `eth_blockNumber` otherwise. Send the result however you like: pass `operations`\n * to `writeContract`, or sign `{ to, data }` offline and push it with `eth_sendRawTransaction`.\n *\n * One check rides on knowing the head: an absolute `atBlock(n)` already in the past is rejected\n * locally only when the head is supplied or was fetched anyway. With neither, a dead-on-arrival\n * expiry encodes cleanly and the engine reverts it on-chain — see\n * {@link BuildMutationOptions.currentBlock}.\n *\n * @throws {InvalidExpiryError} If an expiry exceeds a protocol bound.\n * @throws {InvalidValueError} If an attribute value does not fit the type it names.\n * @throws {EmptyPatchError} If a patch has nothing to apply.\n */\nexport async function buildMutation(\n client: ArkivClient,\n data: EntityMutationOps,\n options: BuildMutationOptions = {},\n): Promise<BuildMutationReturnType> {\n // The head is fetched only when an expiry is actually measured from it and the caller did not\n // supply one — the advanced path never spends an RPC call it can avoid.\n const currentBlock =\n options.currentBlock ??\n (mutationNeedsBlockNumber(data)\n ? // Every SDK-built client carries viem's `publicActions`; `PublicArkivClient` is the type\n // that says so, the same narrowing `sendArkivTransaction` does to `WalletArkivClient`.\n await (client as PublicArkivClient).getBlockNumber()\n : 0n)\n\n const operations = buildEntityOperations(data, { currentBlock })\n logger(\"Built %d operations at block %d\", operations.length, currentBlock)\n\n return {\n operations,\n to: ARKIV_ADDRESS,\n data: encodeFunctionData({ abi: EXECUTE_ABI, functionName: \"execute\", args: [operations] }),\n expected: {\n creates: data.creates?.length ?? 0,\n patches: data.patches?.length ?? 0,\n deletes: data.deletes?.length ?? 0,\n extensions: data.extensions?.length ?? 0,\n ownershipChanges: data.ownershipChanges?.length ?? 0,\n },\n }\n}\n","import { type Hash, type Hex, type TransactionReceipt, TransactionReceiptNotFoundError } from \"viem\"\nimport type { ArkivClient } from \"../../clients/baseClient\"\nimport type { PublicArkivClient } from \"../../clients/createPublicClient\"\nimport { collectMutationEvents } from \"../../utils/arkivTransactions\"\nimport { getLogger } from \"../../utils/logger\"\n\nconst logger = getLogger(\"actions:advanced:get-mutation-result\")\n\n/**\n * A mined mutation, decoded from its receipt alone.\n *\n * Everything here comes out of the events the batch emitted, so no request context is needed to\n * read it — a process that holds nothing but the transaction hash gets the full picture. Arrays\n * are in batch order, which is the order the operations were applied in.\n */\nexport type MutationResult = {\n /** `success` means the whole batch applied; `reverted` means none of it did (arrays are empty). */\n status: \"success\" | \"reverted\"\n /** The transaction hash. */\n txHash: Hash\n /** The block the transaction landed in. */\n blockNumber: bigint\n /** The keys the engine minted for the created entities, in batch order. */\n createdEntities: Hex[]\n /** The block each created entity expires at, as the engine recorded it, in the same order. */\n createdExpiries: bigint[]\n /** The keys of the patched entities. */\n patchedEntities: Hex[]\n /** The keys of the deleted entities. */\n deletedEntities: Hex[]\n /** The keys of the extended entities. */\n extendedEntities: Hex[]\n /** The block each extended entity now expires at, in the same order. */\n extendedExpiries: bigint[]\n /** The keys of the entities handed to a new owner. */\n ownershipChanges: Hex[]\n /** The raw receipt, so nothing the chain said is lost. */\n receipt: TransactionReceipt\n}\n\n/** Return type for {@link getMutationResult}: the decoded result, or still pending. */\nexport type GetMutationResultReturnType = MutationResult | { status: \"pending\" }\n\n/**\n * Decodes a receipt you already hold into a {@link MutationResult}. **Zero RPC calls.**\n *\n * The pure tail of the advanced path: if a receipt reached you some other way — your own\n * `waitForTransactionReceipt`, a webhook, a block watcher — this turns it into entity keys and\n * expiries without touching the network. Lenient by design: it reports what the events say,\n * without counting them against a request it never saw.\n */\nexport function decodeMutationResult(receipt: TransactionReceipt): MutationResult {\n const events = collectMutationEvents(receipt.logs)\n return {\n status: receipt.status,\n txHash: receipt.transactionHash,\n blockNumber: receipt.blockNumber,\n createdEntities: events.created.map((e) => e.entityKey),\n createdExpiries: events.created.map((e) => e.expiresAt),\n patchedEntities: events.patched.map((e) => e.entityKey),\n deletedEntities: events.deleted.map((e) => e.entityKey),\n extendedEntities: events.extended.map((e) => e.entityKey),\n extendedExpiries: events.extended.map((e) => e.expiresAt),\n ownershipChanges: events.ownershipTransferred.map((e) => e.entityKey),\n receipt,\n }\n}\n\n/**\n * Fetches a transaction's receipt — once — and decodes what the mutation did.\n *\n * Exactly one `eth_getTransactionReceipt`, like `pingTransaction`, but the answer carries the\n * decoded entity events as well: created keys, recorded expiries, and the keys of everything\n * patched, deleted, extended or handed over. A transaction that is not mined yet comes back as\n * `{ status: \"pending\" }` — check `status` before reading the rest.\n *\n * No revert diagnosis is run: a `reverted` result reports the fact and the raw receipt, and\n * spending a `simulateContract` on the why is your call, not the SDK's.\n */\nexport async function getMutationResult(\n client: ArkivClient,\n txHash: Hash,\n): Promise<GetMutationResultReturnType> {\n const receipt = await fetchReceipt(client, txHash)\n if (receipt === undefined) {\n logger(\"Tx %s still pending\", txHash)\n return { status: \"pending\" }\n }\n return decodeMutationResult(receipt)\n}\n\n/**\n * One `eth_getTransactionReceipt`, with \"not there yet\" as a value instead of an exception.\n *\n * Internal seam shared with `pingTransaction`; not part of the package's public surface.\n */\nexport async function fetchReceipt(\n client: ArkivClient,\n txHash: Hash,\n): Promise<TransactionReceipt | undefined> {\n // The one action this needs is on every SDK-built client — both factories extend viem's\n // `publicActions` — and `PublicArkivClient` is the type that says so, the same way\n // `sendArkivTransaction` narrows to `WalletArkivClient`.\n const reader = client as PublicArkivClient\n try {\n return await reader.getTransactionReceipt({ hash: txHash })\n } catch (error) {\n // viem models an unmined transaction as a throw; the advanced path models it as a state.\n if (error instanceof TransactionReceiptNotFoundError) return undefined\n throw error\n }\n}\n","import type { Hash } from \"viem\"\nimport type { ArkivClient } from \"../../clients/baseClient\"\nimport { getLogger } from \"../../utils/logger\"\nimport { fetchReceipt } from \"./getMutationResult\"\n\nconst logger = getLogger(\"actions:advanced:ping-transaction\")\n\n/** Return type for {@link pingTransaction}. */\nexport type PingTransactionReturnType =\n | {\n /** Not mined yet (or unknown to this node). Ping again later. */\n status: \"pending\"\n blockNumber?: undefined\n }\n | {\n /** Mined. `success` means the whole batch applied; `reverted` means none of it did. */\n status: \"success\" | \"reverted\"\n /** The block the transaction landed in. */\n blockNumber: bigint\n }\n\n/**\n * Asks the chain — once — whether a transaction has landed.\n *\n * Exactly one `eth_getTransactionReceipt`, never a poll: a transaction that is not mined yet comes\n * back as `{ status: \"pending\" }` rather than being waited on. This is the \"ping\" of the advanced\n * path — you own the schedule, the SDK owns nothing.\n *\n * When it reports `success` and you need the created keys or recorded expiries, spend the next\n * call on `getMutationResult` — or none at all, if you predicted the keys up front with\n * `predictEntityKeys`.\n */\nexport async function pingTransaction(\n client: ArkivClient,\n txHash: Hash,\n): Promise<PingTransactionReturnType> {\n const receipt = await fetchReceipt(client, txHash)\n if (receipt === undefined) {\n logger(\"Tx %s still pending\", txHash)\n return { status: \"pending\" }\n }\n return { status: receipt.status, blockNumber: receipt.blockNumber }\n}\n","import type { Hash } from \"viem\"\nimport type { ArkivClient } from \"../../clients/baseClient\"\nimport type { TxParams } from \"../../types\"\nimport { type EntityMutationOps, submitMutation } from \"../../utils/arkivTransactions\"\nimport { getLogger } from \"../../utils/logger\"\nimport {\n type BuildMutationOptions,\n type BuildMutationReturnType,\n buildMutation,\n} from \"./buildMutation\"\n\nconst logger = getLogger(\"actions:advanced:send-mutation\")\n\n/** Options for {@link sendMutation}. */\nexport type SendMutationOptions = BuildMutationOptions & {\n /**\n * Transaction parameters. Supply `nonce`, `gas` and the fee fields and viem has nothing left to\n * look up — the send collapses to a single `eth_sendRawTransaction`.\n */\n txParams?: TxParams\n}\n\n/** Return type for {@link sendMutation}. */\nexport type SendMutationReturnType = {\n /** The transaction hash. Poll it with `pingTransaction` / fetch it with `getMutationResult`. */\n txHash: Hash\n /** The per-kind operation counts of the batch that was sent, for cross-checking the result. */\n expected: BuildMutationReturnType[\"expected\"]\n}\n\n/**\n * Signs and sends a mutation batch, returning as soon as the transaction is submitted.\n *\n * The fire-and-forget half of the advanced path. Unlike `executeBatch`, this does **not** wait\n * for a receipt, does not poll, and runs no revert diagnosis — it spends only what submitting\n * costs. With `options.currentBlock` and full `txParams` (nonce, gas, fees) that is exactly one\n * RPC call; each omitted piece adds only the lookup viem needs to fill it.\n *\n * Follow up separately, on your own schedule:\n * - `pingTransaction(txHash)` — one `eth_getTransactionReceipt`, tells you pending/success/reverted.\n * - `getMutationResult(txHash)` — the same single call, plus the decoded entity keys and expiries.\n *\n * @throws {EntityMutationError} If the node rejects the submission (the batch never made it into\n * the mempool) — in engine terms when the rejection decodes, with the node's message otherwise.\n * Anything after that — inclusion, success — is yours to check.\n */\nexport async function sendMutation(\n client: ArkivClient,\n data: EntityMutationOps,\n options: SendMutationOptions = {},\n): Promise<SendMutationReturnType> {\n const { operations, expected } = await buildMutation(client, data, options)\n\n logger(\"Sending execute with %d operations (no wait)\", operations.length)\n\n const txHash = await submitMutation(client, operations, options.txParams)\n\n return { txHash, expected }\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,cAAc,SAAS,CAClC,mGACD,CAAC;;;;;;;;AASF,MAAa,mBAAmB,SAAS,CACvC,qEACD,CAAC;;;;;AAMF,MAAM,kBAAkB;;;;;AAMxB,MAAM,iBAAiB;EACpB,cAAc,SAAS,mBACtB,6EAA6E,gBAAgB,cAC9F;EACA,cAAc,QAAQ,mBAAmB,uBAAuB,gBAAgB,aAAa;EAC7F,cAAc,eAAe,mBAC5B,4DACD;EACA,cAAc,oBAAoB,mBAAmB,wCAAwC;EAC7F,cAAc,SAAS,mBAAmB,sBAAsB;CAClE;;AASD,SAAgB,gBAAgB,EAC9B,MACA,QACA,eACA,cAMY;AACZ,QAAO;EACL,WAAW,cAAc;EACzB,eAAe,oBAAoB,eAAe,cAAc,SAAS,CACvE;GACE;GACA,WAAW,OAAO;GAClB,aAAa,OAAO;GACpB;GACA;GACD,CACF,CAAC;EACH;;;AAIH,SAAgB,eAAe,EAC7B,WACA,aAIY;AACZ,QAAO;EACL,WAAW,cAAc;EACzB,eAAe,oBAAoB,eAAe,cAAc,QAAQ,CACtE;GAAE;GAAW;GAAW,CACzB,CAAC;EACH;;;AAIH,SAAgB,sBAAsB,EACpC,WACA,UAIY;AACZ,QAAO;EACL,WAAW,cAAc;EACzB,eAAe,oBAAoB,eAAe,cAAc,eAAe,CAC7E;GAAE;GAAW,WAAW,OAAO;GAAW,aAAa,OAAO;GAAa,CAC5E,CAAC;EACH;;;AAIH,SAAgB,2BAA2B,EACzC,WACA,YAIY;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;;;;;;;AAmC1D,eAAsB,aACpB,QACA,MACA,UAA+B,EAAE,EACA;CACjC,MAAM,EAAE,YAAY,aAAa,MAAM,cAAc,QAAQ,MAAM,QAAQ;AAE3E,QAAO,gDAAgD,WAAW,OAAO;AAIzE,QAAO;EAAE,QAFM,MAAM,eAAe,QAAQ,YAAY,QAAQ,SAAS;EAExD;EAAU"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as SelectArg, s as Entity } from "./selection-
|
|
2
|
-
import { p as AttributeInputs } from "./index-
|
|
1
|
+
import { i as SelectArg, s as Entity } from "./selection-C6KeWJ7g.cjs";
|
|
2
|
+
import { p as AttributeInputs } from "./index-NbfnXxgr.cjs";
|
|
3
3
|
import { n as Expiry, r as ExpiryContext } from "./expiry-DRV29F1r.cjs";
|
|
4
|
-
import {
|
|
4
|
+
import { d as SaltInput, m as Operation } from "./index-DZxwz2Ky.cjs";
|
|
5
5
|
import { n as ResolvedCreationFlags, t as CreationFlags } from "./flags-CRjPpoh3.cjs";
|
|
6
6
|
import { Address, Hash, Hex, TransactionReceipt } from "viem";
|
|
7
7
|
|
|
@@ -22,11 +22,15 @@ type GetBlockTimingReturnType = {
|
|
|
22
22
|
type PredictedEntityKey = {
|
|
23
23
|
/** The key the create will be given. */
|
|
24
24
|
key: Hex;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* The salt the create must carry for its key to come out as {@link PredictedEntityKey.key}.
|
|
27
|
+
* Always a plain `uint128` — a requested {@link NO_SALT} comes back as the `0n` it resolves to,
|
|
28
|
+
* which a create accepts just the same.
|
|
29
|
+
*/
|
|
26
30
|
salt: bigint;
|
|
27
31
|
};
|
|
28
|
-
/** Parameters for
|
|
29
|
-
type PredictEntityKeysParameters<TCount extends number = number, TSalts extends readonly
|
|
32
|
+
/** Parameters for `client.predictEntityKeys`. */
|
|
33
|
+
type PredictEntityKeysParameters<TCount extends number = number, TSalts extends readonly SaltInput[] | undefined = readonly SaltInput[] | undefined> = {
|
|
30
34
|
/** The account that will sign the creates. Its nonce is what the keys are derived from. */
|
|
31
35
|
owner: Address;
|
|
32
36
|
/**
|
|
@@ -39,7 +43,8 @@ type PredictEntityKeysParameters<TCount extends number = number, TSalts extends
|
|
|
39
43
|
count?: TCount | undefined;
|
|
40
44
|
/**
|
|
41
45
|
* The salt each create will carry, in batch order. Defaults to `count` fresh random salts —
|
|
42
|
-
* either way each key comes back paired with the salt that mints it.
|
|
46
|
+
* either way each key comes back paired with the salt that mints it. Pass {@link NO_SALT} in a
|
|
47
|
+
* slot whose create opts out of salting.
|
|
43
48
|
*/
|
|
44
49
|
salts?: TSalts;
|
|
45
50
|
};
|
|
@@ -50,10 +55,10 @@ type PredictEntityKeysParameters<TCount extends number = number, TSalts extends
|
|
|
50
55
|
* tuple, gives a fixed-length tuple; a count computed at runtime gives a plain array.
|
|
51
56
|
*
|
|
52
57
|
* `TSalts` is wrapped in a tuple to stop the conditional distributing over it. Left naked, the
|
|
53
|
-
* `readonly
|
|
54
|
-
* which widens the length straight back to `number`.
|
|
58
|
+
* `readonly SaltInput[] | undefined` default would take both branches and union a tuple with an
|
|
59
|
+
* array, which widens the length straight back to `number`.
|
|
55
60
|
*/
|
|
56
|
-
type PredictEntityKeysReturnType<TCount extends number = number, TSalts extends readonly
|
|
61
|
+
type PredictEntityKeysReturnType<TCount extends number = number, TSalts extends readonly SaltInput[] | undefined = readonly SaltInput[] | undefined> = [TSalts] extends [readonly SaltInput[]] ? { -readonly [Index in keyof TSalts]: PredictedEntityKey } : Repeat<PredictedEntityKey, TCount>;
|
|
57
62
|
/**
|
|
58
63
|
* A tuple of `TLength` × `T`, or a plain array when the length is only known at runtime.
|
|
59
64
|
*
|
|
@@ -72,7 +77,7 @@ type Repeat<T, TLength extends number, TAcc extends T[] = []> = number extends T
|
|
|
72
77
|
*
|
|
73
78
|
* The prediction is valid only while nothing else from this owner is in flight. Every create that
|
|
74
79
|
* lands first takes the nonce with it and moves these keys. For a key you can rely on
|
|
75
|
-
* unconditionally, read it back from the create instead — `createEntity` and `
|
|
80
|
+
* unconditionally, read it back from the create instead — `createEntity` and `executeBatch`
|
|
76
81
|
* report the keys the engine actually minted.
|
|
77
82
|
*
|
|
78
83
|
* @param parameters - Owner, and either a count or the salts. {@link PredictEntityKeysParameters}
|
|
@@ -82,7 +87,7 @@ type Repeat<T, TLength extends number, TAcc extends T[] = []> = number extends T
|
|
|
82
87
|
* import { key } from "@arkiv-network/sdk/attr"
|
|
83
88
|
*
|
|
84
89
|
* const [parent, child] = await client.predictEntityKeys({ owner: account.address, count: 2 })
|
|
85
|
-
* await
|
|
90
|
+
* await client.executeBatch({
|
|
86
91
|
* creates: [
|
|
87
92
|
* { payload, contentType, expires, salt: parent.salt },
|
|
88
93
|
* {
|
|
@@ -278,8 +283,8 @@ type CreateEntityParameters = {
|
|
|
278
283
|
contentType: MimeType | (string & {});
|
|
279
284
|
/**
|
|
280
285
|
* The entity's queryable attributes, keyed by name. Values are the tagged constructors from
|
|
281
|
-
* `@arkiv-network/sdk/attr` — `i32`, `u256`, `dec`, `str`, `addr`, `key`, `bytes32`,
|
|
282
|
-
* a bare `boolean`, `number`, `bigint` or `string` where the type is unambiguous.
|
|
286
|
+
* `@arkiv-network/sdk/attr` — `i32`, `u64`, `u256`, `dec`, `str`, `addr`, `key`, `bytes32`,
|
|
287
|
+
* `bool` — or a bare `boolean`, `number`, `bigint` or `string` where the type is unambiguous.
|
|
283
288
|
*
|
|
284
289
|
* @throws {InvalidAttributeNameError} If a name violates the attribute-name grammar.
|
|
285
290
|
* @throws {InvalidValueError} If a value does not fit the type it names or defaults to.
|
|
@@ -294,10 +299,10 @@ type CreateEntityParameters = {
|
|
|
294
299
|
* The salt mixed into the entity key. Defaults to 128 random bits, which makes the key
|
|
295
300
|
* unpredictable to everyone but the creator.
|
|
296
301
|
*
|
|
297
|
-
* Pass
|
|
298
|
-
* what you want only when a third party must be able to compute the key in advance.
|
|
302
|
+
* Pass {@link NO_SALT} for a key derived from the owner and nonce alone — predictable by anyone,
|
|
303
|
+
* which is what you want only when a third party must be able to compute the key in advance.
|
|
299
304
|
*/
|
|
300
|
-
salt?:
|
|
305
|
+
salt?: SaltInput | undefined;
|
|
301
306
|
};
|
|
302
307
|
/**
|
|
303
308
|
* The result of creating an entity.
|
|
@@ -335,6 +340,31 @@ type DeleteEntityReturnType = {
|
|
|
335
340
|
txHash: Hash;
|
|
336
341
|
};
|
|
337
342
|
//#endregion
|
|
343
|
+
//#region src/actions/wallet/executeBatch.d.ts
|
|
344
|
+
/**
|
|
345
|
+
* Parameters for the executeBatch function — the same batch shape the advanced path takes
|
|
346
|
+
* ({@link EntityMutationOps}), so the two surfaces cannot drift apart.
|
|
347
|
+
*
|
|
348
|
+
* At least one operation is required; a batch with nothing in it throws rather than spending gas on
|
|
349
|
+
* an empty transaction.
|
|
350
|
+
*/
|
|
351
|
+
type ExecuteBatchParameters = EntityMutationOps;
|
|
352
|
+
/** Return type for the executeBatch function. */
|
|
353
|
+
type ExecuteBatchReturnType = {
|
|
354
|
+
/** The transaction hash. */
|
|
355
|
+
txHash: Hash;
|
|
356
|
+
/** The keys of the created entities, in batch order. */
|
|
357
|
+
createdEntities: Hex[];
|
|
358
|
+
/** The keys of the patched entities. */
|
|
359
|
+
patchedEntities: Hex[];
|
|
360
|
+
/** The keys of the deleted entities. */
|
|
361
|
+
deletedEntities: Hex[];
|
|
362
|
+
/** The keys of the extended entities. */
|
|
363
|
+
extendedEntities: Hex[];
|
|
364
|
+
/** The keys of the entities handed to a new owner. */
|
|
365
|
+
ownershipChanges: Hex[];
|
|
366
|
+
};
|
|
367
|
+
//#endregion
|
|
338
368
|
//#region src/actions/wallet/extendEntity.d.ts
|
|
339
369
|
/**
|
|
340
370
|
* Parameters for extending an entity's life.
|
|
@@ -370,31 +400,6 @@ type ExtendEntityReturnType = {
|
|
|
370
400
|
expiresAt: bigint;
|
|
371
401
|
};
|
|
372
402
|
//#endregion
|
|
373
|
-
//#region src/actions/wallet/mutateEntities.d.ts
|
|
374
|
-
/**
|
|
375
|
-
* Parameters for the mutateEntities function — the same batch shape the advanced path takes
|
|
376
|
-
* ({@link EntityMutationOps}), so the two surfaces cannot drift apart.
|
|
377
|
-
*
|
|
378
|
-
* At least one operation is required; a batch with nothing in it throws rather than spending gas on
|
|
379
|
-
* an empty transaction.
|
|
380
|
-
*/
|
|
381
|
-
type MutateEntitiesParameters = EntityMutationOps;
|
|
382
|
-
/** Return type for the mutateEntities function. */
|
|
383
|
-
type MutateEntitiesReturnType = {
|
|
384
|
-
/** The transaction hash. */
|
|
385
|
-
txHash: Hash;
|
|
386
|
-
/** The keys of the created entities, in batch order. */
|
|
387
|
-
createdEntities: Hex[];
|
|
388
|
-
/** The keys of the patched entities. */
|
|
389
|
-
patchedEntities: Hex[];
|
|
390
|
-
/** The keys of the deleted entities. */
|
|
391
|
-
deletedEntities: Hex[];
|
|
392
|
-
/** The keys of the extended entities. */
|
|
393
|
-
extendedEntities: Hex[];
|
|
394
|
-
/** The keys of the entities handed to a new owner. */
|
|
395
|
-
ownershipChanges: Hex[];
|
|
396
|
-
};
|
|
397
|
-
//#endregion
|
|
398
403
|
//#region src/actions/wallet/patchEntity.d.ts
|
|
399
404
|
/**
|
|
400
405
|
* Parameters for patching an entity.
|
|
@@ -427,9 +432,9 @@ type PatchEntityParameters = {
|
|
|
427
432
|
* Attributes to write, keyed by name. An existing attribute is overwritten — including with a
|
|
428
433
|
* different type — and a name the entity does not carry yet is added.
|
|
429
434
|
*
|
|
430
|
-
* Values are the tagged constructors from `@arkiv-network/sdk/attr` — `i32`, `
|
|
431
|
-
* `addr`, `key`, `bytes32`, `bool` — or a bare `boolean`, `number`, `bigint` or
|
|
432
|
-
* type is unambiguous.
|
|
435
|
+
* Values are the tagged constructors from `@arkiv-network/sdk/attr` — `i32`, `u64`, `u256`,
|
|
436
|
+
* `dec`, `str`, `addr`, `key`, `bytes32`, `bool` — or a bare `boolean`, `number`, `bigint` or
|
|
437
|
+
* `string` where the type is unambiguous.
|
|
433
438
|
*
|
|
434
439
|
* @throws {InvalidAttributeNameError} If a name violates the attribute-name grammar.
|
|
435
440
|
* @throws {InvalidValueError} If a value does not fit the type it names or defaults to.
|
|
@@ -465,6 +470,14 @@ type PatchEntityReturnType = {
|
|
|
465
470
|
type MimeType = "text/plain" | "text/html" | "text/css" | "text/csv" | "text/xml" | "text/javascript" | "application/json" | "application/xml" | "application/pdf" | "application/zip" | "application/gzip" | "application/octet-stream" | "application/javascript" | "application/x-www-form-urlencoded" | "image/png" | "image/jpeg" | "image/webp" | "image/gif" | "image/svg+xml" | "audio/mpeg" | "audio/wav" | "audio/ogg" | "video/mp4" | "video/webm" | "video/ogg" | "multipart/form-data";
|
|
466
471
|
//#endregion
|
|
467
472
|
//#region src/types/txParams.d.ts
|
|
473
|
+
/**
|
|
474
|
+
* Transaction fields a write action passes through to the wallet, for the cases where the defaults
|
|
475
|
+
* are not what you want.
|
|
476
|
+
*
|
|
477
|
+
* Fee style is either/or: give `gasPrice` for a legacy transaction, or `maxFeePerGas` /
|
|
478
|
+
* `maxPriorityFeePerGas` for an EIP-1559 one. Mixing the two does not typecheck. Anything left out
|
|
479
|
+
* is estimated.
|
|
480
|
+
*/
|
|
468
481
|
type TxParams = {
|
|
469
482
|
gas?: bigint;
|
|
470
483
|
nonce?: number;
|
|
@@ -567,5 +580,5 @@ type MutationEvents = {
|
|
|
567
580
|
*/
|
|
568
581
|
declare function collectMutationEvents(logs: TransactionReceipt["logs"]): MutationEvents;
|
|
569
582
|
//#endregion
|
|
570
|
-
export { PredictEntityKeysParameters as A, EntityEvent as C, OwnershipTransferredEvent as D, ExpiryExtendedEvent as E, PredictedEntityKey as M, GetBlockTimingReturnType as N, QueryOptions as O, EntityDeletedEvent as S, EntityPatchedEvent as T, DeleteEntityReturnType as _, mutationNeedsBlockNumber as a, WatchEntityEventsParameters as b, TxParams as c, PatchEntityReturnType as d,
|
|
571
|
-
//# sourceMappingURL=arkivTransactions-
|
|
583
|
+
export { PredictEntityKeysParameters as A, EntityEvent as C, OwnershipTransferredEvent as D, ExpiryExtendedEvent as E, PredictedEntityKey as M, GetBlockTimingReturnType as N, QueryOptions as O, EntityDeletedEvent as S, EntityPatchedEvent as T, DeleteEntityReturnType as _, mutationNeedsBlockNumber as a, WatchEntityEventsParameters as b, TxParams as c, PatchEntityReturnType as d, ExtendEntityParameters as f, DeleteEntityParameters as g, ExecuteBatchReturnType as h, collectMutationEvents as i, PredictEntityKeysReturnType as j, QueryReturnType as k, MimeType as l, ExecuteBatchParameters as m, MutationEvents as n, ChangeOwnershipParameters as o, ExtendEntityReturnType as p, buildEntityOperations as r, ChangeOwnershipReturnType as s, EntityMutationOps as t, PatchEntityParameters as u, CreateEntityParameters as v, EntityEventContext as w, EntityCreatedEvent as x, CreateEntityReturnType as y };
|
|
584
|
+
//# sourceMappingURL=arkivTransactions-BpARZOsH.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arkivTransactions-BpARZOsH.d.cts","names":[],"sources":["../src/actions/public/getBlockTiming.ts","../src/actions/public/predictEntityKeys.ts","../src/actions/public/query.ts","../src/types/events.ts","../src/actions/public/watchEntityEvents.ts","../src/actions/wallet/createEntity.ts","../src/actions/wallet/deleteEntity.ts","../src/actions/wallet/executeBatch.ts","../src/actions/wallet/extendEntity.ts","../src/actions/wallet/patchEntity.ts","../src/types/mimeTypes.ts","../src/types/txParams.ts","../src/actions/wallet/changeOwnership.ts","../src/utils/arkivTransactions.ts"],"sourcesContent":[],"mappings":";;;;;;;;KAKY,wBAAA;;;;;;;;;;;;AAAZ;KCaY,kBAAA;;OAEL;EAFK;AAYZ;;;;EAaU,IAAA,EAAA,MAAA;CAMA;;AAaE,KAhCA,2BAgC2B,CAAA,eAAA,MAAA,GAAA,MAAA,EAAA,eAAA,SA9Bb,SA8Ba,EAAA,GAAA,SAAA,GAAA,SA9BsB,SA8BtB,EAAA,GAAA,SAAA,CAAA,GAAA;EAEb;EAAmC,KAAA,EA7Bp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