Documentation Index
Fetch the complete documentation index at: https://docs.peaq.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Choose how writes return:
- FAST (default): returns a string tx-hash immediately after submission
- FINAL: waits for finalization and returns a structured result
from peaq_robot import PeaqRobot
from peaq_robot.types import TxOptions, ConfirmationMode
import asyncio
sdk = PeaqRobot()
# FAST
tx = sdk.store.add_data("FAST_DEMO", {"ok": True})
print(tx)
# FINAL
res = sdk.store.add_data(
"FINAL_DEMO", {"ok": True},
tx_options=TxOptions(mode=ConfirmationMode.FINAL)
)
final_receipt = asyncio.run(res.finalize)
print(final_receipt)
Outputs:
- FAST returns a string tx-hash like
0x4a8b...9f.
- FINAL status progression (abridged):
{'status': 'TransactionStatus.BROADCAST', 'hash': '0x4a8b...9f'}
{'status': 'TransactionStatus.IN_BLOCK', 'hash': '0x4a8b...9f'}
{'status': 'TransactionStatus.FINALIZED', 'hash': '0x4a8b...9f'}
Final receipt (shape):
{
"extrinsic_hash": "0x4a8b...9f",
"success": true,
"events": [
{ "event": "ExtrinsicSuccess", "phase": "ApplyExtrinsic" },
{ "event": "System.ExtrinsicSuccess", "phase": "Finalization" }
]
}