Skip to content

WalletArkivActions

WalletArkivActions<transport, chain, account> = Pick<PublicActions<transport, chain, account>, "waitForTransactionReceipt" | "call"> & Pick<WalletActions<chain, account>, "addChain" | "sendCalls" | "waitForCallsStatus" | "sendTransaction" | "sendRawTransaction" | "signMessage" | "signTransaction"> & object

Defined in: src/clients/decorators/arkivWallet.ts:34

changeOwnership: (data, txParams?) => Promise<ChangeOwnershipReturnType>

Changes the ownership of the entity with the given address.

ChangeOwnershipParameters

The ownership change parameters

TxParams

Optional transaction parameters

Promise<ChangeOwnershipReturnType>

The entity with updated ownership and transaction hash

createEntity: (data, txParams?) => Promise<CreateEntityReturnType>

Creates a new entity.

CreateEntityParameters

The entity creation parameters

TxParams

Optional transaction parameters

Promise<CreateEntityReturnType>

The created entity with transaction hash

import { createPublicClient, http } from 'arkiv'
import { braga } from 'arkiv/chains'
const client = createPublicClient({
chain: braga,
transport: http(),
})
const { entityKey, txHash } = await client.createEntity({
payload: toBytes(JSON.stringify({ entity: { entityType: "testType", entityId: "testId" } })),
attributes: [{ key: "testKey", value: "testValue" }],
expiresIn: 1000,
})
console.log("entityKey", entityKey)
console.log("txHash", txHash)
// {
// entityKey: "0x123",
// txHash: "0x123",
// }

deleteEntity: (data, txParams?) => Promise<DeleteEntityReturnType>

Deletes the entity with the given key.

DeleteEntityParameters

The entity deletion parameters

TxParams

Optional transaction parameters

Promise<DeleteEntityReturnType>

The deleted entity with transaction hash

import { createWalletClient, http } from 'arkiv'
import { braga } from 'arkiv/chains'
const client = createWalletClient({
chain: braga,
transport: http(),
})
const { entityKey, txHash } = await client.deleteEntity({ entityKey: "0x123" })
console.log("entityKey", entityKey)
console.log("txHash", txHash)
// {
// entityKey: "0x123",
// txHash: "0x123",
// }

extendEntity: (data, txParams?) => Promise<ExtendEntityReturnType>

Extends the entity with the given key.

ExtendEntityParameters

The entity update parameters

TxParams

Optional transaction parameters

Promise<ExtendEntityReturnType>

The updated entity with transaction hash

import { createWalletClient, http } from 'arkiv'
import { braga } from 'arkiv/chains'
const client = createWalletClient({
chain: braga,
transport: http(),
})
const { entityKey, txHash } = await client.extendEntity("0x123", {
expiresIn: 1000,
})
console.log("entityKey", entityKey)
console.log("txHash", txHash)
// {
// entityKey: "0x123",
// txHash: "0x123",
// }

mutateEntities: (data, txParams?) => Promise<MutateEntitiesReturnType>

Mutates the entities with the given keys.

MutateEntitiesParameters

The mutation parameters (creates, updates, deletes, extensions)

TxParams

Optional transaction parameters

Promise<MutateEntitiesReturnType>

The mutation result with transaction hash

import { createWalletClient, http } from 'arkiv'
import { braga } from 'arkiv/chains'
const client = createWalletClient({
chain: braga,
transport: http(),
})
const { entityKey, txHash } = await client.mutateEntities({
creates: [{
payload: toBytes(JSON.stringify({ entity: { entityType: "testType", entityId: "testId" } })),
attriubutes: [{ key: "testKey", value: "testValue" }],
expiresIn: 1000,
}],
updates: [{
entityKey: "0x123",
payload: toBytes(JSON.stringify({ entity: { entityType: "testType", entityId: "testId" } })),
attributes: [{ key: "testKey", value: "testValue" }],
expiresIn: 1000,
}],
deletes: [{
entityKey: "0x321",
}],
extensions: [{
entityKey: "0x1234",
expiresIn: 1000,
}],
})
console.log("entityKey", entityKey)
console.log("txHash", txHash)
// {
// entityKey: "0x123",
// txHash: "0x123",
// }

updateEntity: (data, txParams?) => Promise<UpdateEntityReturnType>

Updates the entity with the given key.

UpdateEntityParameters

The entity update parameters

TxParams

Optional transaction parameters

Promise<UpdateEntityReturnType>

The updated entity with transaction hash

import { createWalletClient, http } from 'arkiv'
import { braga } from 'arkiv/chains'
const client = createWalletClient({
chain: braga,
transport: http(),
})

transport extends Transport = Transport

chain extends Chain | undefined = Chain | undefined

account extends Account | undefined = Account | undefined