PatchEntityParameters
PatchEntityParameters =
object
Defined in: src/actions/wallet/patchEntity.ts:34
Parameters for patching an entity.
A patch names only what changes. Attributes it does not mention keep whatever value they have, and the payload and content type stay as they are unless given — so a caller can change one field without first reading the entity to learn what the others are, and without racing anyone else who is changing a different field.
The entity’s identity is fixed: a patch never moves the key, the owner, the creation flags or the
expiry. Use extendEntity for the expiry and changeOwnership for the owner.
Examples
Section titled “Examples”Change one attribute and remove another, leaving the payload alone:await client.patchEntity({ entityKey, set: { status: "published", level: i32(11) }, unset: ["draft"],})Replace the contents without touching a single attribute:await client.patchEntity({ entityKey, payload: jsonToPayload({ hello: "again" }),})Properties
Section titled “Properties”contentType?
Section titled “contentType?”
optionalcontentType:MimeType|string&object
Defined in: src/actions/wallet/patchEntity.ts:66
The payload’s new MIME type. Omit it to keep the current one — which is what you want when the new payload is the same kind of thing as the old.
entityKey
Section titled “entityKey”entityKey:
Hex
Defined in: src/actions/wallet/patchEntity.ts:36
The entity to patch.
payload?
Section titled “payload?”
optionalpayload:Uint8Array
Defined in: src/actions/wallet/patchEntity.ts:61
The entity’s new payload. Omit it to leave the current contents untouched; pass an empty
Uint8Array to replace them with nothing.
optionalset:AttributeInputs
Defined in: src/actions/wallet/patchEntity.ts:48
Attributes to write, keyed by name. An existing attribute is overwritten — including with a different type — and a name the entity does not carry yet is added.
Values are the tagged constructors from @arkiv-network/sdk/attr — i32, u256, dec, str,
addr, key, bytes32, bool — or a bare boolean, number, bigint or string where the
type is unambiguous.
Throws
Section titled “Throws”If a name violates the attribute-name grammar.
Throws
Section titled “Throws”If a value does not fit the type it names or defaults to.
unset?
Section titled “unset?”
optionalunset: readonlystring[]
Defined in: src/actions/wallet/patchEntity.ts:56
Attribute names to remove. Naming one the entity does not carry is not an error — the outcome is the same either way, and a caller clearing a field should not have to know whether it was ever set.
Throws
Section titled “Throws”If a name also appears in set.