Mint USD testnet tokens
curl --request POST \
--url https://api.tokenlayer.network/functions/v1/mint-usd \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chainSlug": "base-sepolia",
"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": 100000
}
'import requests
url = "https://api.tokenlayer.network/functions/v1/mint-usd"
payload = {
"chainSlug": "base-sepolia",
"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": 100000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainSlug: 'base-sepolia',
userAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
amount: 100000
})
};
fetch('https://api.tokenlayer.network/functions/v1/mint-usd', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenlayer.network/functions/v1/mint-usd",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chainSlug' => 'base-sepolia',
'userAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'amount' => 100000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlayer.network/functions/v1/mint-usd"
payload := strings.NewReader("{\n \"chainSlug\": \"base-sepolia\",\n \"userAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": 100000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenlayer.network/functions/v1/mint-usd")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chainSlug\": \"base-sepolia\",\n \"userAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": 100000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlayer.network/functions/v1/mint-usd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainSlug\": \"base-sepolia\",\n \"userAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": 100000\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"transaction": {
"to": "0x3Ea905bE91e23876a0DAd8ee62fBBee63B7FBDeb",
"data": "0x449a52f8...",
"value": "0",
"gasLimit": "100000",
"chainType": "evm",
"chainId": "eip155:84532"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Utilities
Mint USD testnet tokens
Prepares a transaction to mint USD testnet tokens (e.g., USDC) on supported chains. This is a testnet-only function for development and testing purposes. Returns transaction data that the frontend can execute via the user’s wallet.
POST
/
mint-usd
Mint USD testnet tokens
curl --request POST \
--url https://api.tokenlayer.network/functions/v1/mint-usd \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"chainSlug": "base-sepolia",
"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": 100000
}
'import requests
url = "https://api.tokenlayer.network/functions/v1/mint-usd"
payload = {
"chainSlug": "base-sepolia",
"userAddress": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
"amount": 100000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chainSlug: 'base-sepolia',
userAddress: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
amount: 100000
})
};
fetch('https://api.tokenlayer.network/functions/v1/mint-usd', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tokenlayer.network/functions/v1/mint-usd",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chainSlug' => 'base-sepolia',
'userAddress' => '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'amount' => 100000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tokenlayer.network/functions/v1/mint-usd"
payload := strings.NewReader("{\n \"chainSlug\": \"base-sepolia\",\n \"userAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": 100000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tokenlayer.network/functions/v1/mint-usd")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"chainSlug\": \"base-sepolia\",\n \"userAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": 100000\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tokenlayer.network/functions/v1/mint-usd")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chainSlug\": \"base-sepolia\",\n \"userAddress\": \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\",\n \"amount\": 100000\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"transaction": {
"to": "0x3Ea905bE91e23876a0DAd8ee62fBBee63B7FBDeb",
"data": "0x449a52f8...",
"value": "0",
"gasLimit": "100000",
"chainType": "evm",
"chainId": "eip155:84532"
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
JWT token or API key
Body
application/json
Blockchain identifier. Supported chains: solana, solana-devnet, arbitrum, base, base-sepolia, avalanche, op-bnb, bnb, bnb-testnet, ethereum, monad, unichain, unichain-testnet, abstract, polygon, zksync, zksync-testnet
Available options:
solana, solana-devnet, arbitrum, base, base-sepolia, avalanche, op-bnb, bnb, bnb-testnet, ethereum, monad, unichain, unichain-testnet, abstract, polygon, zksync, zksync-testnet Example:
"base-sepolia"
User wallet address to mint tokens to
Pattern:
^0x[a-fA-F0-9]{40}$Example:
"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
Amount of USD to mint (defaults to 100,000)
Required range:
x > 0Example:
100000
⌘I
