Execute an Attestation
Once an attestation has been verified, it can be executed to mint or burn tokens. This guide explains how to execute an attestation using an authorized wallet.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure:
- The attestation has been verified
- Your wallet has permission to perform the mint or burn (e.g.
MINTER_ROLE
)
Endpoint
Section titled “Endpoint”POST /v2/stablecoin/{stablecoinId}/attestation/{attestationId}/use
Request Parameters
Section titled “Request Parameters”{ "signerWalletId": "{{walletId}}"}
-
signerWalletId
: Wallet authorized to execute the on-chain mint or burn. This is often the same wallet that has been granted MINTER_ROLE
. Example Request
Section titled “Example Request”curl -X POST https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/{{attestationId}}/use \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "signerWalletId": "{{walletId}}" }'
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;
const useAttestation = async () => { const response = await axios.post( 'https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/{{attestationId}}/use', { signerWalletId: '{{walletId}}' }, { headers: { Authorization: `Bearer ${FSCO_API_KEY}`, 'Content-Type': 'application/json' } } );
console.log('Attestation used:', response.data);};
useAttestation();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = { "Authorization": f"Bearer {FSCO_API_KEY}", "Content-Type": "application/json",}
payload = {"signerWalletId": "{{walletId}}"}
response = requests.post( "https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/{{attestationId}}/use", json=payload, headers=headers,)
print("Attestation used:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Text;using System.Threading.Tasks;
class Program{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY");
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var json = @"{ ""signerWalletId"": ""{{walletId}}"" }"; var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/attestation/{{attestationId}}/use", content); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Attestation used: " + responseString); }}
Response
Section titled “Response”{ "queryId": "txn_abc123456"}
A successful response indicates the on-chain mint or burn transaction has been submitted. You can track the result via the transaction hash in the attestation metadata or by querying the chain.