WalletArkivActions
WalletArkivActions<
transport,chain,account> =Pick<PublicActions<transport,chain,account>,"waitForTransactionReceipt"|"call"|"simulateContract"|"readContract"|"getBlockNumber"> &Pick<WalletActions<chain,account>,"addChain"|"sendCalls"|"waitForCallsStatus"|"sendTransaction"|"sendRawTransaction"|"signMessage"|"signTransaction"|"writeContract"> &object
Defined in: src/clients/decorators/arkivWallet.ts:31
Type Declaration
Section titled “Type Declaration”changeOwnership()
Section titled “changeOwnership()”changeOwnership: (
data,txParams?) =>Promise<ChangeOwnershipReturnType>
Changes the ownership of the entity with the given address.
- Docs: https://docs.arkiv.network/ts-sdk/actions/wallet/changeOwnership
- JSON-RPC Methods:
eth_sendRawTransaction
Parameters
Section titled “Parameters”The ownership change parameters
txParams?
Section titled “txParams?”Optional transaction parameters
Returns
Section titled “Returns”Promise<ChangeOwnershipReturnType>
The entity with updated ownership and transaction hash
createEntity()
Section titled “createEntity()”createEntity: (
data,txParams?) =>Promise<CreateEntityReturnType>
Creates a new entity.
- Docs: https://docs.arkiv.network/ts-sdk/actions/wallet/createEntity
- JSON-RPC Methods:
eth_sendRawTransaction
Parameters
Section titled “Parameters”The entity creation parameters
txParams?
Section titled “txParams?”Optional transaction parameters
Returns
Section titled “Returns”Promise<CreateEntityReturnType>
The created entity with transaction hash
Throws
Section titled “Throws”If the expiry exceeds a protocol bound or would leave the entity dead on arrival.
Throws
Section titled “Throws”If an attribute value does not fit the type it names.
Throws
Section titled “Throws”If a name violates the attribute-name grammar.
Example
Section titled “Example”import { createWalletClient, ExpirationTime, jsonToPayload } from "@arkiv-network/sdk"import { i32 } from "@arkiv-network/sdk/attr"import { cheesecake } from "@arkiv-network/sdk/chains"import { http } from "viem"
const client = createWalletClient({ chain: cheesecake, transport: http(),})const { entityKey, txHash, expiresAt } = await client.createEntity({ payload: jsonToPayload({ entityType: "testType", entityId: "testId" }), contentType: "application/json", attributes: { testKey: "testValue", level: i32(3) }, expires: ExpirationTime.fromDays(30),})deleteEntity()
Section titled “deleteEntity()”deleteEntity: (
data,txParams?) =>Promise<DeleteEntityReturnType>
Deletes the entity with the given key.
- Docs: https://docs.arkiv.network/ts-sdk/actions/wallet/deleteEntity
- JSON-RPC Methods:
eth_sendRawTransaction
Parameters
Section titled “Parameters”The entity deletion parameters
txParams?
Section titled “txParams?”Optional transaction parameters
Returns
Section titled “Returns”Promise<DeleteEntityReturnType>
The deleted entity with transaction hash
Example
Section titled “Example”import { createWalletClient } from "@arkiv-network/sdk"import { cheesecake } from "@arkiv-network/sdk/chains"import { http } from "viem"
const client = createWalletClient({ chain: cheesecake, transport: http(),})// entityKey is the bytes32 key returned by createEntity.const { txHash } = await client.deleteEntity({ entityKey })extendEntity()
Section titled “extendEntity()”extendEntity: (
data,txParams?) =>Promise<ExtendEntityReturnType>
Sets a new expiry on the entity with the given key.
The new lifetime is resolved the same way a create’s is: a duration counts from now rather
than adding to what the entity has left, and atBlock / atDate pin an absolute deadline.
The engine rejects an extension that would not move the expiry later.
- Docs: https://docs.arkiv.network/ts-sdk/actions/wallet/extendEntity
- JSON-RPC Methods:
eth_sendRawTransaction
Parameters
Section titled “Parameters”The entity key and its new lifetime
txParams?
Section titled “txParams?”Optional transaction parameters
Returns
Section titled “Returns”Promise<ExtendEntityReturnType>
The entity key, transaction hash, and the block it is now expected to expire at
Throws
Section titled “Throws”If the expiry is malformed, exceeds a protocol bound, or would leave the entity dead on arrival.
Example
Section titled “Example”import { createWalletClient, ExpirationTime } from "@arkiv-network/sdk"import { cheesecake } from "@arkiv-network/sdk/chains"import { http } from "viem"
const client = createWalletClient({ chain: cheesecake, transport: http(),})const { txHash, expiresAt } = await client.extendEntity({ entityKey, expires: ExpirationTime.fromDays(30),})mutateEntities()
Section titled “mutateEntities()”mutateEntities: (
data,txParams?) =>Promise<MutateEntitiesReturnType>
Mutates the entities with the given keys.
- Docs: https://docs.arkiv.network/ts-sdk/actions/wallet/mutateEntities
- JSON-RPC Methods:
eth_sendRawTransaction
Every operation lands in one transaction, so the whole batch applies or none of it does. At least one operation is required.
Parameters
Section titled “Parameters”The mutation parameters (creates, patches, deletes, extensions, ownershipChanges)
txParams?
Section titled “txParams?”Optional transaction parameters
Returns
Section titled “Returns”Promise<MutateEntitiesReturnType>
The mutation result with transaction hash
Throws
Section titled “Throws”If an expiry exceeds a protocol bound or would leave the entity dead on arrival.
Throws
Section titled “Throws”If an attribute value does not fit the type it names.
Example
Section titled “Example”import { createWalletClient, ExpirationTime, jsonToPayload } from "@arkiv-network/sdk"import { cheesecake } from "@arkiv-network/sdk/chains"import { http } from "viem"
const client = createWalletClient({ chain: cheesecake, transport: http(),})const { txHash, createdEntities } = await client.mutateEntities({ creates: [{ payload: jsonToPayload({ entityType: "testType", entityId: "testId" }), contentType: "application/json", attributes: { testKey: "testValue" }, expires: ExpirationTime.fromDays(30), }], patches: [{ entityKey: keyToRevise, set: { status: "archived" }, unset: ["draft"] }], deletes: [{ entityKey: staleKey }], extensions: [{ entityKey: keyToKeepAlive, expires: ExpirationTime.atBlock(1_200_000n), }], ownershipChanges: [{ entityKey: keyToHandOver, newOwner }],})patchEntity()
Section titled “patchEntity()”patchEntity: (
data,txParams?) =>Promise<PatchEntityReturnType>
Applies a patch to the entity with the given key: sets some fields, unsets others, and leaves everything it does not name alone.
- Docs: https://docs.arkiv.network/ts-sdk/actions/wallet/patchEntity
- JSON-RPC Methods:
eth_sendRawTransaction
Parameters
Section titled “Parameters”The entity key and the mutations to apply
txParams?
Section titled “txParams?”Optional transaction parameters
Returns
Section titled “Returns”Promise<PatchEntityReturnType>
The entity key and the transaction hash
Throws
Section titled “Throws”If the patch has nothing to apply.
Throws
Section titled “Throws”If a name appears in both set and unset.
Throws
Section titled “Throws”If an attribute value does not fit the type it names.
Throws
Section titled “Throws”If a name violates the attribute-name grammar.
Example
Section titled “Example”import { createWalletClient, jsonToPayload } from "@arkiv-network/sdk"import { i32 } from "@arkiv-network/sdk/attr"import { cheesecake } from "@arkiv-network/sdk/chains"import { http } from "viem"
const client = createWalletClient({ chain: cheesecake, transport: http(),})// Publish the entity: one attribute changes, one goes away, the payload is replaced.const { txHash } = await client.patchEntity({ entityKey, set: { status: "published", revision: i32(2) }, unset: ["draft"], payload: jsonToPayload({ title: "Hello" }),})Type Parameters
Section titled “Type Parameters”transport
Section titled “transport”transport extends Transport = Transport
chain extends Chain | undefined = Chain | undefined
account
Section titled “account”account extends Account | undefined = Account | undefined