Quickstart: Mint SBC on testnets

Use the Brale API to mint SBC on Polygon Mumbai Testnet.

1. Sign up for a Brale account

Visit Brale's signup page to create an account. Testnet accounts are free, and signup takes less than 30 seconds.

Brale API

2. Create an Application

Create an application on the Settings page in the Dashboard. Select testnet access, and toggle on mint and redemption permissions. You should store your secret, as it’s only shown once during generation.

Brale API

To help navigate the API, you can download our OpenAPI Spec, or our Postman Library here.

You can also use the Brale CLI to streamline common interactions with the API.

3. Authenticate

Brale uses OAuth2 with the client_credentials grant type for secure access to our APIs. Sending a request to the Auth endpoint will return a bearer token to be used on all subsequent calls. The Authorization header uses Basic HTTP Authentication and requires encoding your client_id and client_secret into a Base64 format.

curl --request POST \
  --url https://auth.brale.xyz/oauth2/token \
  --header 'Authorization: Basic ${BASE_64_OF(client_id:client_secret)}' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials

See Authentication for additional details.

4. Mint 10 SBC on Polygon Mumbai Testnet

Now that you have your access token, you can submit requests directly in the API Reference docs, or following the example below.

SBC, Brale's example stablecoin, is automatically available on all supported testnets for your organization.

  1. GET /tokens to first view all available tokens, which includes SBC. See List Tokens
  2. GET tokens/:id/deployments to view all chain deployments for SBC. See List a Token's Deployments
  3. GET /addresses to view your EVM custodial address. Your EVM custodial wallet is automatically present with the type "custodial" and supports all EVM chains, including Mumbai. See List Addresses
  4. POST /deployments/:id/mints See Mint
    1. You'll need to include a unique Idempotency-Key in the request header
    2. Include the ID of the specific chain deployment you'd like to mint on. The ID of the Mumbai testnet deployment for SBC is 2L6KGa2XZuviW90Y1oPGpV8dSff
    3. Include the amount you'd like to mint, with a currency type of USD
    4. Include the destination wallet ID you retrieved above, along with type address
    5. Include a type of order
curl --request POST \
  --url https://api.brale.xyz/deployments/2L6KGa2XZuviW90Y1oPGpV8dSff/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": "10"
			}
		},
		"relationships": {
			"destination": {
				"id": "2Xs0gvJN72Kk7UZgaYQl7FyUdLT",
				"type": "address"
			}
		},
		"type": "order"
	}
}'

You can view the balance of SBC on Mumbai you just minted to your wallet in the Brale UI or on https://mumbai.polygonscan.com/.