Mint and Redeem on Mainnets

Use the Brale API to mint and redeem stablecoins with USDC or USD on supported mainnets.

Brale's API supports minting and redeeming branded stablecoins funded with USDC, or USD via wire transfer.

In this guide, we'll explore minting SBC with USDC, and then redeeming it back to USDC.

1. Fund your custodial wallet with native USDC on Avalanche, Polygon, or Ethereum

For initial testing, we recommend using USDC on Avalanche due to its near-instant settlement and low fees.

GET /addresses to view your EVM custodial address. Your EVM custodial wallet is automatically present with the type "custodial" and supports all EVM chains.

Transfer native USDC on Avalanche from an EOA or exchange wallet to your custodial wallet address. Brale's API does not currently support retrieving balances, so you can confirm the balance in your wallet through Brale's UI or on https://avascan.info/.

2. Mint SBC funded by USDC on Avalanche

GET /tokens to first view all available tokens, which includes SBC.

GET tokens/:id/deployments to view all chain deployments for SBC. For initial testing, we recommend using SBC's Avalanche deployment, but many other chains are supported.

POST /deployments/:id/mints

  • You'll need to include a unique Idempotency-Key in the request header.
  • Include the ID of the specific chain deployment you'd like to mint SBC on. The ID of the Avalanche deployment for SBC is TBD.
  • Include the amount you'd like to mint, with a currency type of USD.
  • Include your EVM custodial wallet ID you retrieved above, along with type address.
  • Include the ID of USDC's chain deployment you are funding from, along with type deployment. The ID of the USDC's Avalanche Deployment is 2DuCecq7HirADKJCLRM4Aji8ZP4.
  • Include type of order.
curl --request POST \
  --url https://api.brale.xyz/deployments/{ID}/mints \
  --header 'Content-Type: application/vnd.api+json' \
  --header 'Idempotency-Key: ABC_123_XYZ' \
  --header 'authorization: Bearer K-PBmBWw1-8j3xwf1mqdJDd6vnur-GJ71PHrgRKeJnA.uprMHAYlLDADh5536LqkoBYsBUFB-Wmioz9FeqWJ7PM' \
  --data '{
	"data": {
		"attributes": {
			"amount": {
				"currency": "USD",
				"value": "1"
			}
		},
		"relationships": {
			"destination": {
				"id": "2Xs0gvJN72Kk7UZgaYQl7FyUdLT",
				"type": "address"
			},
      "funding-deployment": {
        "id": "2DuCecq7HirADKJCLRM4Aji8ZP4",
        "type": "deployment"
      }
		},
		"type": "order"
	}
}'

USDC will be transferred out of your custodial wallet, and SBC will be minted into it. Typically this will settle within 2 minutes.

3. Redeem SBC to USDC

Now we're going to redeem the SBC that was just minted back to Avalanche USDC.

POST /deployments/:id/redemptions\

  • You'll need to include a unique Idempotency-Key in the request header.
  • Include the ID of the specific chain deployment you'd like to redeem SBC on. The ID of the Avalanche deployment for SBC is TBD.
  • Include the amount you'd like to redeem, with a currency type of USD.
  • Include your EVM custodial wallet ID in the payment-destination, along with type address.
  • Include the ID of USDC's chain deployment you are funding to, along with type deployment. The ID of the USDC's Avalanche Deployment is 2DuCecq7HirADKJCLRM4Aji8ZP4.
  • Include type of order.
curl --request POST \
  --url https://api.brale.xyz/deployments/{ID}/redemptions \
  --header 'Content-Type: application/vnd.api+json' \
  --header 'Idempotency-Key: ABC_123_XYZ' \
  --header 'authorization: Bearer K-PBmBWw1-8j3xwf1mqdJDd6vnur-GJ71PHrgRKeJnA.uprMHAYlLDADh5536LqkoBYsBUFB-Wmioz9FeqWJ7PM' \
  --data '{
  "data": {
    "attributes": {
      "amount": {
        "currency": "USD",
        "value": "1"
      }
    },
    "relationships": {
      "payment-deployment": {
        "id": "2DuCecq7HirADKJCLRM4Aji8ZP4",
        "type": "deployment"
      },
      "payment-destination": {
        "id": "2Xs0gvJN72Kk7UZgaYQl7FyUdLT",
        "type": "address"
      }
    },
    "type": "order"
  }
}

The tokens will now be burned, and upon completion, the USDC is transferred to your custodial wallet.