---
name: wake402-buyer
description: Discover WAKE402 and safely purchase one delayed HTTPS callback with x402 v2 on Base Mainnet.
version: 1.0.0
homepage: https://wake402.agentwake.workers.dev
---

# WAKE402 buyer skill

WAKE402 schedules one future HTTPS callback. The buyer pays exactly 0.002 USDC
for one wake. No WAKE402 account or API key is required.

## Discovery path

1. Discover the WAKE402 `POST /v1/wake-after` resource through an x402 Bazaar
   catalog entry.
2. Read this skill: <https://wake402.agentwake.workers.dev/skill.md>.
3. Use the reusable TypeScript buyer adapter:
   <https://wake402.agentwake.workers.dev/examples/wake402-client.ts>.

The Bazaar entry is discovery metadata. Payment goes directly to the native
WAKE402 x402 endpoint; there is no marketplace proxy or second paywall.

## Purchase contract

- Endpoint: `POST https://wake402.agentwake.workers.dev/v1/wake-after`
- Content type: `application/json`
- Request body:

```json
{
  "callback": "https://agent.example.com/wake",
  "delay_seconds": 300
}
```

- `callback` must be a public HTTPS URL the buyer is authorized to use.
- `delay_seconds` must be an integer from 60 through 86400.
- Price: exactly 0.002 USDC (`2000` atomic units).
- Network: Base Mainnet (`eip155:8453`).
- Scheme: x402 v2 Exact EVM.
- Asset: Base Mainnet USDC
  (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`).

## Operational delivery contract

The unpaid HTTP 402 JSON body exposes `wake402_delivery_contract` before any
Payment Identifier or signature is created. Version 1 is the only contract
supported by the reusable adapter. It must fail closed on any material change.

```json
{
  "version": "1",
  "delivery_semantics": "at-least-once",
  "successful_delivery_guaranteed": false,
  "exact_second_timing_guaranteed": false,
  "timing": {
    "expectation": "for or shortly after the requested scheduled time",
    "successful_delivery_sla_guaranteed": false
  },
  "schedule": {
    "min_delay_seconds": 60,
    "max_delay_seconds": 86400
  },
  "callback": {
    "method": "POST",
    "content_type": "application/json",
    "redirects_followed": false,
    "timeout_ms": 5000,
    "authentication": {
      "mode": "none"
    },
    "idempotency_key": {
      "header": "Idempotency-Key",
      "present": true,
      "value_semantics": "wake_id"
    },
    "body": {
      "format": "fixed",
      "additional_properties": false,
      "fields": {
        "type": { "const": "wake402.wake" },
        "wake_id": { "value_semantics": "wake_id" },
        "scheduled_at": { "value_semantics": "scheduled wake time" },
        "fired_at": { "value_semantics": "delivery attempt time" }
      }
    }
  },
  "retry": {
    "first_delivery_attempt": "at-or-after-scheduled-time",
    "retry_limit": 3,
    "maximum_total_attempts": 4,
    "initial_retry_delay": "5 seconds",
    "backoff": "exponential",
    "network_failures_retryable": true,
    "callback_timeout_retryable": true,
    "retryable_http_statuses": [408, 425, 429, 500, 501, 502, 503, 504, 505, 506, 507, 508, 510, 511],
    "other_http_failures_retryable": false
  },
  "failure": {
    "terminal_state": "delivery_failed",
    "successful_delivery_sla_guaranteed": false,
    "callback_response_body_retained": false,
    "automatic_refund_on_delivery_failure": false
  },
  "expiry": {
    "absolute_wall_clock_delivery_expiry_guaranteed": false,
    "semantics": "delivery processing ends on success, non-retryable failure, or bounded retry exhaustion; no absolute wall-clock expiry is promised"
  }
}
```

0.002 USDC buys one wake, not guaranteed successful delivery or exact-second
execution. The buyer must process callbacks idempotently. In V1 callback
authentication is `none`; redirects are not followed; `Idempotency-Key` equals
`wake_id`; terminal delivery failure is `delivery_failed`; and delivery failure
alone does not trigger an automatic refund.

## Required buyer proofs

The HTTP 402 challenge must advertise both of these as required. Fail closed
if either declaration is missing, optional, malformed, or different from the
expected production terms.

1. `payment-identifier`: create exactly one unique Payment Identifier for the
   purchase.
2. `wake402-request-commitment`: create the required v2 EIP-712 proof with the
   same injected `ClientEvmSigner` used by Exact EVM.

The commitment binds the Payment Identifier, canonical callback,
`delay_seconds`, request fingerprint, network, asset, amount, and `payTo`. The
recovered commitment signer must equal the x402 payer.

## Reusable buyer adapter

Install the versions listed at the top of the public TypeScript file, then
import `buyWake402WakeAfter`. The host wallet injects a `ClientEvmSigner`; no
buyer credential is sent to or stored by WAKE402.

```ts
import { buyWake402WakeAfter } from "./wake402-client.ts";

const checked = await buyWake402WakeAfter({
  request: {
    callback: "https://agent.example.com/wake",
    delay_seconds: 300,
  },
  dryRun: true,
});

const created = await buyWake402WakeAfter({
  signer: buyerSigner,
  request: {
    callback: "https://agent.example.com/wake",
    delay_seconds: 300,
  },
});
```

Dry-run sends only the unpaid request, validates the live HTTP 402 payment and
delivery terms, returns the validated operational contract, and creates no
Payment Identifier, authorization, commitment proof, or paid request. A paid
call validates the same terms before invoking the signer.

Do not send, print, serialize, or persist wallet credentials. Keep signing in
the buyer-controlled wallet or agent runtime.

## Retry safety

- Serialize the request once. The unpaid request and paid request must use the
  identical body.
- A successful purchase is only an HTTP 201 response with a valid WAKE402
  `WakeCreated` body.
- A timeout, connection loss, HTTP 503, or malformed paid response can be
  ambiguous. Do not create a second Payment Identifier or a second payment
  authorization.
- Any recovery request must reuse the identical body and exact original
  `PAYMENT-SIGNATURE`, including the same authorization, nonce, Payment
  Identifier, and commitment signature.
- The adapter deliberately fails closed after an ambiguous paid result and
  never signs a replacement authorization automatically.

Delivery is at-least-once. Treat callback processing as idempotent and use the
returned `status_url` for independent observation.
