Skip to main content

usdctofiat

USDCtoFiat by Galleon Labs. Python client for non-custodial USDC-to-fiat cash-out on Base.

Built on the public Peer/ZKP2P protocol. Not a Peer Cash product. Not Peerlytics.

https://usdctofiat.xyz · https://usdctofiat.xyz/developers

Install

pip install usdctofiat

This repository is the source. A PyPI release is a separate publish step and is not part of this scaffold.

Cash out

mode is required. Fast is 0% spread / 0 bps and earns TOFIAT. Best is Delegate at 10 bps.

The client never takes a wallet private key. Pass a signer callback that submits an unsigned tx, or call prepare() and sign in the host.

from usdctofiat import cashout, create_offramp

def signer(tx):
    # Host signs and submits {to, data, value, chain_id}. Return the tx hash.
    return submit(tx)

order = cashout(
    mode="fast",
    signer=signer,
    amount="100",
    currency="EUR",
    platform="revolut",
    payee="alice",
)
print(order.deposit_id, order.tx_hash, order.mode)

Strings and numbers are human USDC amounts. An int is exact six-decimal base units.

Prepare without a signer

offramp = create_offramp()
prepared = offramp.prepare(
    mode="fast",
    amount="100",
    currency="EUR",
    platform="revolut",
    payee="alice",
)
for tx, step in zip(prepared.txs, prepared.steps):
    print(step, tx.to, tx.data[:10])

create_offramp() locks attribution to peer-ref-TOFIAT then galleonlabs. Inbound referral_code and peer-ref-* values are discarded. Extra analytics referrers may be appended after those two.

What v1 does

  • Fast prepare-path: public curator POST /v2/makers/create (no API key), then unsigned USDC approve + EscrowV2 createDeposit at the oracle floor (0 bps, no Delegate vault), with ERC-8021 on every tx.
  • Best is the same deposit plus a Delegate setRateManager hook so the API exists. The hook is encoded after a deposit_id is known. No Relay. No attestation mint.
  • estimate, watch, withdraw / close, and deposits talk to the public indexer.

There is no POST /cashout. Deposit creation is onchain.

Base mainnet

Chain 8453
USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
EscrowV2 0x777777779d229cdF3110e9de47943791c26300Ef

HTTP: https://api.zkp2p.xyz and https://indexer.zkp2p.xyz/v1/graphql.

Agno toolkit draft

A local UsdctoFiatTools draft lives in examples/agno/. It is a copy-ready scaffold for a future agno-agi/agno PR (agno[usdctofiat]). It is not an installable Agno first-party tool. Do not open that host PR while the external cap is full. Mode is required. No private-key constructor.

Licence

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usdctofiat-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usdctofiat-0.1.0-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file usdctofiat-0.1.0.tar.gz.

File metadata

  • Download URL: usdctofiat-0.1.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for usdctofiat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 95a000e6a4a6181b5ba99deb4159b0b09c39c691511b028fcf76105195632b5c
MD5 8f3782b804ee799619cc766f6c8ad1cc
BLAKE2b-256 2d50fc24512a5942a8a9a08e94f947e69715d3d9be6f730e01ed8a1361eaee8d

See more details on using hashes here.

File details

Details for the file usdctofiat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: usdctofiat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for usdctofiat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b5b6225497d05b786cdf4397cb90f741d29066f5a4143a6b4a44b168f0d620b9
MD5 25eb6718d9fa9827f51d1d6591c347ae
BLAKE2b-256 dbd413862494ada48aa5f38bb085f09ecff649544f865343e5b5c2a1221bb42a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page