# TempaiTown Bazaar Trading Skill

Use this skill when a human wants an external agent to buy, sell, place offers, cancel offers, or transfer TempaiTown bazaar agents with that human's Tempo access key.

- Generated: 2026-04-17T14:13:59.079Z
- Public site guide: https://auramaxx.gg/bazaar/trading.md
- API guide: https://api.auramaxx.gg/bazaar/trading.md
- Public site: https://auramaxx.gg/bazaar
- API base URL: https://api.auramaxx.gg
- Developer capabilities: https://api.auramaxx.gg/api/tempo/developer/v1/capabilities
- Network: Tempo Mainnet (4217)
- Fee token: pathUSD (0x20c0000000000000000000000000000000000000)

## Required setup

- Read `~/Downloads/tempo-agent.json` first.
- The backend derives the active user wallet from the authenticated developer token and access-key bundle.
- Never override that wallet in quote or prepare payloads.
- Use the one-step developer auth bootstrap route first when you have the external agent bundle locally.
- Legacy challenge/verify still exists as a fallback for older agents, but new agents should prefer bootstrap.

## Auth

- Preferred bootstrap: https://api.auramaxx.gg/api/tempo/developer/v1/agent-auth/bootstrap
- Bootstrap body: include the `tempo-agent.json` bundle or an equivalent object with `wallet`, `accessKey`, and `privateKey`.
- Legacy fallback challenge: https://api.auramaxx.gg/api/tempo/developer/v1/agent-auth/challenge
- Legacy fallback verify: https://api.auramaxx.gg/api/tempo/developer/v1/agent-auth/verify
- Auth response returns a bearer token. Send it as `Authorization: Bearer <token>` on the developer marketplace endpoints below.

## Read surface

- Catalog: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/catalog
- Offers: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offers
- Item-specific offers: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offers/:agentId
- Inventory: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/inventory

## Trading routes

- Buy quote: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/buy/quote
- Buy prepare: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/buy/prepare
- Buy submit: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/buy/submit
- Offer quote: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offer/quote
- Offer prepare: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offer/prepare
- Offer submit: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offer/submit
- Cancel-offer quote: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offer/cancel/quote
- Cancel-offer prepare: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offer/cancel/prepare
- Cancel-offer submit: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/offer/cancel/submit
- Sell quote: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/sell/quote
- Sell prepare: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/sell/prepare
- Sell submit: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/sell/submit
- Transfer quote: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/transfer/quote
- Transfer prepare: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/transfer/prepare
- Transfer submit: https://api.auramaxx.gg/api/tempo/developer/v1/marketplace/transfer/submit

## Execution model

- Quote routes return the latest backend view of pricing, inventory, or offer state for the authenticated wallet.
- Prepare routes return the exact Tempo call batch or sequential `transactions[]` to sign locally with the human's delegated access key.
- Submit routes accept the signed tx hash after broadcast and force webhook rescue plus projection/inventory waits from the backend.
- The prepare response includes either `transaction.calls` or ordered `transactions[]`, plus `transaction.from` and `keyAuthorizationRequired` derived from the authenticated developer wallet.
- Current relay mode: client-sign. Do not assume the create sponsor relay can submit bazaar trading calls.

## Default buy flow

1. Load the catalog and identify the exact `agentId` from the current backend payload.
2. Call buy quote with the requested `items`.
3. Review `subtotalUnits`, `subtotalLabel`, and any `allowanceTargets`.
4. Call buy prepare with the same payload.
5. If prepare returned `transactions[]`, sign and send them sequentially; otherwise sign and send `transaction.calls` from the authenticated wallet using the access key from `tempo-agent.json`.
6. Call buy submit with the same payload plus `txHash` or ordered `txHashes`.
7. Return the transaction hash to the human.

## Default offer flow

1. Load the current offers for the target agent.
2. Call offer quote with the target `agentId`, `pricePerItemUnits`, and `quantity`.
3. Call offer prepare with the same payload.
4. Sign and send the prepared calls locally with the user's access key.
5. Call offer submit with the same payload plus `txHash`.

## Default sell flow

1. Read the authenticated inventory.
2. Call sell quote with the exact owned `agentId` items the human selected.
3. Call sell prepare with the same payload.
4. Sign and send the returned calls locally with the user's access key.
5. Call sell submit with the same payload plus `txHash`.

## Default transfer flow

1. Read the authenticated inventory.
2. Confirm the destination address with the human exactly.
3. Call transfer quote, then transfer prepare, with the same `destinationAddress` and item list.
4. If the prepare response includes `fallbackCalls`, keep them as a legacy fallback if the native batch transfer fails.
5. After broadcast, call transfer submit with the same payload plus `txHash`.

## Example payloads

Buy:
```json
{
  "items": [
    {
      "agentId": "0xa8427e61457d06567bb2891ac4b53562e2a4d9dd:1",
      "quantity": 1
    }
  ]
}
```

Offer:
```json
{
  "agentId": "0xa8427e61457d06567bb2891ac4b53562e2a4d9dd:1",
  "pricePerItemUnits": "3000000",
  "quantity": 1
}
```

Sell:
```json
{
  "items": [
    {
      "agentId": "0xa8427e61457d06567bb2891ac4b53562e2a4d9dd:1",
      "quantity": 1
    }
  ]
}
```

Transfer:
```json
{
  "destinationAddress": "0x1111111111111111111111111111111111111111",
  "items": [
    {
      "agentId": "0xa8427e61457d06567bb2891ac4b53562e2a4d9dd:1",
      "quantity": 1
    }
  ]
}
```

## Guardrails

- Do not guess an `agentId`. Read it from the current catalog or inventory first.
- Do not place, cancel, buy, sell, or transfer anything without an explicit human request.
- Do not sign a transaction whose `from` address does not match the authenticated developer wallet.
- Do not silently change quantity, destination, or price between quote and prepare.
- Do not assume sponsorship for bazaar trading. If the wallet cannot pay Tempo fees, stop and tell the human.
- If the request is ambiguous, ask the human which exact bazaar action they want.
