Overview
Brale is a stablecoin platform that provides regulated stablecoin issuance, compliance, reserve management, custody, on and offramps, and transfers through a unified API. In this guide we’ll show how to:- Use Turnkey to provision a Base EVM address, then constrain signing with a Turnkey policy.
- Register that address in Brale as an
Address. - Use Brale to fund the address via an inbound USD
Automation. - Use Brale to send stablecoins out via a direct
Transfer.
Getting started
Prerequisites
- A Turnkey organization with:
- A root user API key (admin operations)
- A non-root user API key (day-to-day signing)
- An EVM wallet with a Base address, funded with a small amount of ETH for gas
- Brale API credentials (
client_idandclient_secret). See Authentication. - Brale sandbox or testnet first, then mainnet. See Sandbox and testnet.
- A stablecoin and chain to test with, for example SBC on Base. See transfer_type and value_type.
Environment variables
You will reference these throughout.Set up a constrained Turnkey signer (EVM, Base)
Create a policy for the non-root user
Use the root API key to create a policy, but use the non-root API key for signing transactions so the policy engine is enforced. This example policy restricts the non-root user to sending transactions only to a small allowlist of contracts. Replace the allowlist with whatever your application needs.Create a viem account backed by Turnkey
Authenticate to Brale
Brale uses a bearer token obtained fromclient_id and client_secret. See
Authentication.
Store the resulting token as BRALE_ACCESS_TOKEN.
Create a Brale Account
AnAccount represents your customer (end user or business) in Brale. See
Accounts.
Capture ACCOUNT_ID.
Register the Turnkey EVM address as a Brale Address
In Brale, anAddress is the universal source and destination primitive for onchain and offchain
endpoints. See Addresses.
Create an Address for turnkeyEvmAddress on Base, capture TURNKEY_ADDRESS_ID.
Inbound USD funding via Brale Automations (event-driven)
Automations provision a unique set of USD funding instructions. When USD arrives, Brale automatically creates aTransfer to mint and send stablecoins to your
configured destination address. See Automations.
Create an Automation
Create an automation that mints SBC on Base to your Turnkey address.Fetch funding instructions
Once the automation is active, Brale populatessource.funding_instructions.
Reconcile inbound activity via Transfers
When USD hits the automation’s virtual account, Brale will create aTransfer automatically.
Outbound stablecoin payout via Transfers (API-driven)
ATransfer moves value between fiat and stablecoins, between stablecoins, and to external
addresses. See Transfers.
Register the recipient address
Create a second BraleAddress for the external recipient on Base, capture RECIPIENT_ADDRESS_ID.
Create a payout transfer
This example sends SBC on Base from your Turnkey address to the external recipient.TRANSFER_ID from the response.
Retrieve the transfer until terminal
Use GET to retrieve a single transfer and checkstatus (pending, processing, complete,
failed).
List transfers for reconciliation
Security considerations
- Use Turnkey non-root users plus policies for least-privilege signing.
- Never ship Brale
client_secretto browsers. - Always include
Idempotency-Keyon Brale create POSTs, and reuse the same key when retrying the same logical operation.