# Integrate Usdctofiat Offramp

> Integrate @usdctofiat/offramp v8 into an app, bot, or agent for Base USDC cash-out. Use when adding an offramp, selling USDC for fiat, choosing fast or best routing, building private OTC orders, onboarding verified payees, or connecting cash-out activity to Peerlytics.

- **Type:** Skill
- **Install:** `agentstack add skill-adwilkinson-usdctofiat-peerlytics-starters-integrate-usdctofiat-offramp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ADWilkinson](https://agentstack.voostack.com/s/adwilkinson)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ADWilkinson](https://github.com/ADWilkinson)
- **Source:** https://github.com/ADWilkinson/usdctofiat-peerlytics-starters/tree/main/skills/claude/integrate-usdctofiat-offramp
- **Website:** https://offramp-sdk.vercel.app

## Install

```sh
agentstack add skill-adwilkinson-usdctofiat-peerlytics-starters-integrate-usdctofiat-offramp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Integrate USDCtoFiat Offramp v8

Use `cashout()` as the default integration path. Require callers to choose
`mode: "fast"` or `mode: "best"`; never silently choose a mode for them.

## Install

```bash
npm install @usdctofiat/offramp viem
```

Require Node 22+, viem 2.x, and a connected viem `WalletClient` on Base.

## Ship the first cash-out

```typescript
import { cashout } from "@usdctofiat/offramp";
import type { WalletClient } from "viem";

export async function sellUsdc(signer: WalletClient) {
  const order = await cashout({
    mode: "fast",
    signer,
    amount: "100",
    currency: "EUR",
    platform: "revolut",
    payee: "alice",
  });

  // Persist this immediately; it is the cross-device/process resume key.
  console.log(order.depositId);
  return order;
}
```

Treat strings and numbers as human USDC amounts. Treat a `bigint` as exact
six-decimal base units. Validate free-form handles before submitting:

```typescript
import { PLATFORMS } from "@usdctofiat/offramp";

const validation = PLATFORMS.REVOLUT.validate(input);
if (!validation.valid) throw new Error(validation.error);
const payee = validation.normalized;
```

## Choose the mode explicitly

- Use `fast` for the direct Peer Cash route at the live oracle rate with 0 bps
  spread. Its composite `depositId` works with `createOfframp().order()`,
  `.watch()`, and `.withdraw()`.
- Use `best` for Delegate-managed pricing. It returns a numeric EscrowV2
  `depositId` that works with `deposits()` and `close()`, and has a 10 bps fill
  fee.

Never infer that `best` is always cheaper or that `fast` always settles first;
the names identify routing policies, not a guaranteed outcome.

## Follow and recover a fast order

```typescript
import { createOfframp } from "@usdctofiat/offramp";

const cash = createOfframp();

for await (const order of cash.watch(depositId)) {
  console.log(order.state, order.explain());
  if (!order.isInFlight) break;
}
```

Use the advanced client for estimates, multiple payout routes, order history,
Relay source routing, withdrawals, top-ups, and unsigned transaction
preparation. Keep the client stable across React renders. React hooks live at
`@usdctofiat/offramp/react`: `useEstimate`, `useCashout`, `useOrder`, and
`useOrders`.

## Create a private OTC cash-out

offramp 9 rejects `otcTaker` on fresh creation with `UNSUPPORTED`. The protocol
cannot create a deposit paused and private atomically, so a one-call private
order would leave a public window open between creation and restriction.
Restrict the deposit after it confirms instead:

```typescript
import { cashout, enableOtc, getOtcLink } from "@usdctofiat/offramp";

const order = await cashout({
  mode: "fast",
  signer,
  amount: "250",
  currency: "EUR",
  platform: "revolut",
  payee: "alice",
});

const { otcLink } = await enableOtc(signer, order.depositId, "0xBuyerWallet");
console.log(otcLink, getOtcLink(order.depositId));
```

Reopen the deposit with `disableOtc(signer, depositId, {})`; the options
argument is required in v9. Both helpers resolve the exact payment-method set
from ProtocolViewer and fail before any policy write when that projection is
stale, partial, or contradictory. If restriction fails after cash-out creation,
preserve the returned `depositId` and `txHash` and retry `enableOtc()`; do not
create a second order.

## Gate a payment rail

Pass `disabledPlatforms` to `cashout()` or `createOfframp()` to drop rails from
capability discovery and reject them before any new deposit. Cash App ships
disabled by default in `OFFRAMP_DISABLED_PAYMENT_PLATFORMS`; read
`DISABLED_PAYMENT_PLATFORM_MESSAGE` for the user-facing copy and check a rail
with `isPaymentPlatformDisabled(platform, disabledPlatforms)`.

## Handle errors

```typescript
import { CashError, OfframpError, cashout } from "@usdctofiat/offramp";

try {
  await cashout(input);
} catch (error) {
  if (error instanceof CashError) {
    console.error(error.code, error.retryable, error.remediation);
  } else if (error instanceof OfframpError) {
    console.error(error.code, error.depositId, error.txHash);
  }
  throw error;
}
```

Present the typed remediation to the user, preserve any order identifiers on
the error, and retry only when the error marks the operation retryable.

## Onboard verified payees

Use `createOfframp().registerPayee()` for extension-verified handles, then
reuse the returned handle in `cashout()`. Consult the current verified-payees
guide before implementing PayPal, Wise, Venmo, or Cash App onboarding; their
extension requirements can change independently of an app's UI.

## Keep managed v5 flows explicit

Use the compatibility API only when automatic Delegate-vault management or a
legacy EscrowV2 lifecycle is specifically required:

```typescript
import {
  CURRENCIES,
  PLATFORMS,
  createManagedOfframp,
} from "@usdctofiat/offramp/managed";

const managed = createManagedOfframp({ walletClient });
await managed.createDeposit({
  amount: "100",
  currency: CURRENCIES.EUR,
  platform: PLATFORMS.REVOLUT,
  identifier: "alice",
});
```

Do not present the compatibility `offramp()` helper, `useOfframp()` hook, or
`createManagedOfframp()` factory as the v8 golden path.

## Preserve attribution and resources

The v8 distribution automatically applies `peer-ref-TOFIAT` and
`galleonlabs`. Do not pass the removed v5 `integratorId` or `referralId` fields
to the flat `cashout()` input. Advanced clients may append an analytics code
with `createOfframp({ referrer: "my-wallet" })`; they cannot replace the fixed
financial referral.

Use the package resource exports instead of hardcoding integration links:

```typescript
import {
  OFFRAMP_DEVELOPER_RESOURCES,
  getOfframpDeveloperResources,
} from "@usdctofiat/offramp";

console.log(OFFRAMP_DEVELOPER_RESOURCES.links.fullMachineReference);
console.log(getOfframpDeveloperResources("bot"));
```

## Verify

- Confirm the signer is on Base mainnet (chain ID 8453).
- Validate the amount and payout handle before wallet activity.
- Persist `depositId` immediately after success.
- Exercise the selected mode with a small real order before release.
- Use Peerlytics or the explorer to confirm the resulting order/deposit.

## References

- Canonical machine reference: https://usdctofiat.xyz/llms-full.txt
- Starters: https://github.com/ADWilkinson/usdctofiat-peerlytics-starters
- SDK reference in the starters: https://github.com/ADWilkinson/usdctofiat-peerlytics-starters/blob/main/usdctofiat/llms.txt

The hosted developer portal, SDK guide and canonical skill under usdctofiat.xyz/developers are 404
as of 2026-09-02; the SDK itself is unaffected and its coordination API still answers.
- Peerlytics explorer: https://peerlytics.xyz/explorer (the Peerlytics API and developer portal are 404 as of 2026-09-02)

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ADWilkinson](https://github.com/ADWilkinson)
- **Source:** [ADWilkinson/usdctofiat-peerlytics-starters](https://github.com/ADWilkinson/usdctofiat-peerlytics-starters)
- **License:** MIT
- **Homepage:** https://offramp-sdk.vercel.app

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-adwilkinson-usdctofiat-peerlytics-starters-integrate-usdctofiat-offramp
- Seller: https://agentstack.voostack.com/s/adwilkinson
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
