Skip to main content
The peaq network allows you to store on-chain data using a simple key: value structure.

add_item(item_type, item)

Adds a new key-value pair to the on-chain storage. If the item is not already a string, it will be automatically JSON-serialized before storage.

Add Item Code Examples

get_item(item_type, address)

Retrieves a stored item by its key for the specified address. Returns the decoded value as a string. Cross-chain storage querying:
  • Substrate: Uses the existing Substrate API connection directly to query storage
  • EVM: Automatically uses the SDK’s base_url to create a temporary Substrate connection.
* The address is required when no seed is set.

Get Item Code Examples

update_item(item_type, item)

Updates an existing item in on-chain storage by replacing its value with a new one. The item will be automatically JSON-serialized if it’s not already a string.

Update Item Code Examples

remove_item(item_type)

Removes an existing key-value pair from on-chain storage.

Remove Item Code Examples