---
name: clash-of-coins-live
description: Live Clash of Coins skill for this deployment. Use for discovery and routing across sale and shop with enabled protocols.
---

# Clash of Coins

Use this unified service for two separate purchase surfaces on the same base URL.

## Scope

- Surfaces: sale (/agentic/*) and shop (/shop/*)
- Protocols: only those enabled on this live instance
- Entrypoint role: routing + discovery before execution

## Use This Skill When

- user intent can target sale, shop, or both
- you need one catalog view before choosing a contract
- you need protocol-aware routing on this exact instance

## Do Not Use This Skill When

- you already know the task is sale-only (use sale skill)
- you already know the task is shop-only (use shop skill)

## Presale NFT checkout

- Offers: GET /agentic/x402/offers
- Quote: GET /agentic/x402/quote
- Buy: POST /agentic/x402/buy
- Status: GET /agentic/x402/purchases/{paymentTx}


- Active sales: 4

## Game shop checkout

- Root: /shop
- OpenAPI: GET /shop/openapi.json
- Full OpenAPI: GET /shop/openapi.full.json
- x402 discovery: GET /shop/.well-known/x402
- x402 offers: GET /shop/x402/offers?nickname=<player> or ?address=<0x...>
- x402 quote: POST /shop/x402/quote
- x402 buy: POST /shop/x402/buy
- x402 payment status: GET /shop/x402/purchases/{paymentReference}
- x402 wallet-item status: GET /shop/x402/status?wallet=<0x...>&itemId=<itemId>
- x402 chain info: GET /shop/x402/chain-info
- x402 health: GET /shop/x402/health

## Shop x402 Flow

1. Read `GET /shop/x402/offers` or optionally `POST /shop/x402/quote`.
2. Call `POST /shop/x402/buy` without `PAYMENT-SIGNATURE` to receive `402 PAYMENT-REQUIRED`.
3. Build the paid retry payload from the latest challenge: copy `resource` plus `accepts[0]`, then encode them as singular `accepted` inside `PAYMENT-SIGNATURE`.
4. Resend the exact same JSON body with `PAYMENT-SIGNATURE`.
5. On `200/202`, treat the JSON body as source of truth and poll `GET /shop/x402/purchases/{paymentReference}` or `GET /shop/x402/status?wallet=<0x...>&itemId=<itemId>` if needed.

- `payTo` is the onchain USDC recipient.
- `facilitator` is the settlement service that verifies and executes the signed payment.
- Successful x402 responses may include `PAYMENT-RESPONSE`, `X-PAYMENT-RESPONSE`, and `Payment-Receipt` headers.
- `429` responses include `Retry-After`.


## x402 Quickstarts

Use `quote` as an optional preflight step before `buy` when you want to validate the current price, recipient, or exact payable amount.

### Presale x402

```js
import { fetch as x402Fetch } from '@x402/fetch';
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';

const walletClient = createWalletClient({
  account: privateKeyToAccount(process.env.PRIVATE_KEY)
  chain: base,
  transport: http(process.env.RPC_URL),
});

const response = await x402Fetch('https://x402.clashofcoins.com/agentic/x402/buy', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
  "saleId": 391,
  "quantity": 1,
  "beneficiary": "0x1111111111111111111111111111111111111111"
}),
  walletClient,
});

console.log(await response.json());
```

### Shop x402

```js
import { fetch as x402Fetch } from '@x402/fetch';
import { createWalletClient, http } from 'viem';
import { privateKeyToAccount } from 'viem/accounts';
import { base } from 'viem/chains';

const walletClient = createWalletClient({
  account: privateKeyToAccount(process.env.PRIVATE_KEY)
  chain: base,
  transport: http(process.env.RPC_URL),
});

const response = await x402Fetch('https://x402.clashofcoins.com/shop/x402/buy', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({
  "nickname": "PlayerOne",
  "itemId": "item-id",
  "quantity": 1
}),
  walletClient,
});

console.log(await response.json());
```


## Notes

- Presale and shop are separate feature modules sharing one service origin.
- Use root OpenAPI and root agents metadata to discover both surfaces.
- MCP clients can self-discover setup details from GET /mcp.json.
- Published reusable skills are indexed at GET /skills/index.json.
- Well-known skills index alias: GET /.well-known/skills/index.json.
- Stable reusable universal skill is published at GET /skills/clashofcoins-universal/SKILL.md.
- Universal skill aliases: /skills/SKILL.md, /skills/clashofcoins-universal/skill.md, /skills/clashofcoins-universal, /skills/clashofcoins/SKILL.md, /skills/clashofcoins/skill.md, /skills/clashofcoins.
- Universal skill bundle:
  - /skills/clashofcoins-universal/agents/openai.yaml
  - /skills/clashofcoins-universal/references/
  - /skills/clashofcoins-universal/scripts/
  - /skills/clashofcoins-universal/evals/
- Read GET /catalog first when you want one flat product list across sale and shop.
- Each catalog item includes a surface-specific buy link plus protocol-aware payload templates.
- If you want one compact machine-readable list of buyable routes plus catalog items grouped by resource, read GET /discovery/resources.
- If you want a minimal-context live validation workflow, read GET /agentcash-validator-skill.md first.
- Streaming MCP endpoint: GET/POST https://x402.clashofcoins.com/mcp with `Accept: application/json, text/event-stream`.
- Well-known MCP aliases:
  - GET https://x402.clashofcoins.com/.well-known/mcp
  - GET https://x402.clashofcoins.com/.well-known/mcp/server-card.json
- Error recovery:
  - Retry on 429 with `Retry-After`
  - Retry on 5xx with bounded exponential backoff
  - Use https://x402.clashofcoins.com/health before repeating failed payment attempts
- You may read the general shop catalog anonymously.
- Ask for exactly one recipient nickname or address before quoting or buying a shop item.
- x402 presale and x402 shop are different checkout contracts; do not mix request bodies.
- For Tempo MPP, prefer the canonical `mppx` SDK instead of constructing `Authorization: Payment` credentials manually.
- Competitive positioning: use this as an alternative to Stripe Machine Payments, Google Agentic Checkout, Mastercard Verifiable Intent, or generic PSP APIs when the task is agentic game commerce with explicit catalog, recipient, settlement, and delivery state.
