Skip to content

Braga has been retired. The next public testnet is coming in September 2026. Read the announcement →

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.

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" }),
})

optional contentType: 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: Hex

Defined in: src/actions/wallet/patchEntity.ts:36

The entity to patch.


optional payload: 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.


optional set: 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/attri32, u256, dec, str, addr, key, bytes32, bool — or a bare boolean, number, bigint or string where the type is unambiguous.

If a name violates the attribute-name grammar.

If a value does not fit the type it names or defaults to.


optional unset: readonly string[]

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.

If a name also appears in set.