> ## 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.

# Options test

title: Options & Callbacks

FAST vs FINAL confirmation using the PyPI package. Save as `options_test.py` and run with a funded account.

```python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
import asyncio, time
from peaq_robot import PeaqRobot
from peaq_robot.types import TxOptions, ConfirmationMode

sdk = PeaqRobot()

# FAST (string tx-hash)
tx1 = sdk.store.add_data(f"OPT_FAST_{int(time.time())}", {"t": int(time.time())})
print("FAST:", tx1)

# FINAL (awaitable finalize)
def on_status(s):
    try:
        print(s.model_dump())
    except Exception:
        print({"status": str(s.status), "hash": s.hash})

res = sdk.store.add_data(
  f"OPT_FINAL_{int(time.time())}", {"t": int(time.time())},
  tx_options=TxOptions(mode=ConfirmationMode.FINAL),
  on_status=on_status,
)
final_receipt = asyncio.run(res.finalize)
print("FINALIZED:", str(final_receipt)[:180])
```

Install first:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
pip install -U peaq-robotics-sdk
```

PyPI: [peaq-robotics-sdk](https://pypi.org/project/peaq-robotics-sdk/)

Expected output (abridged):

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
FAST: 0x3b7f...e1
{'status': <TransactionStatus.BROADCAST: 'BROADCAST'>, 'hash': '0x3b7f...e1', ...}
{'status': <TransactionStatus.IN_BLOCK: 'IN_BLOCK'>, 'hash': '0x3b7f...e1', ...}
{'status': <TransactionStatus.FINALIZED: 'FINALIZED'>, 'hash': '0x3b7f...e1', ...}
FINALIZED: {'extrinsic_hash': '0x3b7f...e1', 'success': True, 'events': [...]} 
```
