Manage Roles
Roles define who can submit, verify, mint, burn, or administer a stablecoin. This guide walks you through assigning or removing roles for specific wallets using FSCO’s API.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure:
- You have a deployed stablecoin and its
stablecoinId
- Your signer wallet has permission to manage roles (usually
DEFAULT_ADMIN_ROLE
)
Assign a Role
Section titled “Assign a Role”Endpoint
Section titled “Endpoint”POST /v2/stablecoin/{stablecoinId}/role
Example Request
Section titled “Example Request”curl -X POST https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "ATTESTATION_MANAGER", "role": "SUBMITTER_ROLE", "roleWalletId": "{{walletId}}", "signerWalletId": "{{walletId}}" }'
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;
const addStablecoinRole = async () => { const response = await axios.post( 'https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role', { type: 'ATTESTATION_MANAGER', role: 'SUBMITTER_ROLE', roleWalletId: '{{walletId}}', signerWalletId: '{{walletId}}' }, { headers: { Authorization: `Bearer ${FSCO_API_KEY}`, 'Content-Type': 'application/json' } } );
console.log('Role added:', response.data);};
addStablecoinRole();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = { "Authorization": f"Bearer {FSCO_API_KEY}", "Content-Type": "application/json",}
payload = { "type": "ATTESTATION_MANAGER", "role": "SUBMITTER_ROLE", "roleWalletId": "{{walletId}}", "signerWalletId": "{{walletId}}",}
response = requests.post( "https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role", json=payload, headers=headers,)
print("Role added:", 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 = @"{ ""type"": ""ATTESTATION_MANAGER"", ""role"": ""SUBMITTER_ROLE"", ""roleWalletId"": ""{{walletId}}"", ""signerWalletId"": ""{{walletId}}"" }"; var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role", content); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Role added: " + responseString); }}
Request Parameters
Section titled “Request Parameters”{ "type": "ATTESTATION_MANAGER", "role": "SUBMITTER_ROLE", "roleWalletId": "{{walletId}}", "signerWalletId": "{{walletId}}"}
type
: Role group:ATTESTATION_MANAGER
orCOLLATERALISED_TOKEN
role
: Specific role to assign (see supported roles below)roleWalletId
: Wallet receiving the rolesignerWalletId
: Wallet authorized to assign roles
Remove a Role
Section titled “Remove a Role”Endpoint
Section titled “Endpoint”DELETE /v2/stablecoin/{stablecoinId}/role
Example Request
Section titled “Example Request”curl -X DELETE https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "type": "ATTESTATION_MANAGER", "role": "SUBMITTER_ROLE", "roleWalletId": "{{walletId}}", "signerWalletId": "{{walletId}}" }'
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;
const removeStablecoinRole = async () => { const response = await axios.delete( 'https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role', { data: { type: 'ATTESTATION_MANAGER', role: 'SUBMITTER_ROLE', roleWalletId: '{{walletId}}', signerWalletId: '{{walletId}}' }, headers: { Authorization: `Bearer ${FSCO_API_KEY}`, 'Content-Type': 'application/json' } } );
console.log('Role removed:', response.data);};
removeStablecoinRole();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = { "Authorization": f"Bearer {FSCO_API_KEY}", "Content-Type": "application/json",}
payload = { "type": "ATTESTATION_MANAGER", "role": "SUBMITTER_ROLE", "roleWalletId": "{{walletId}}", "signerWalletId": "{{walletId}}",}
response = requests.delete( "https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role", json=payload, headers=headers,)
print("Role removed:", 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 = @"{ ""type"": ""ATTESTATION_MANAGER"", ""role"": ""SUBMITTER_ROLE"", ""roleWalletId"": ""{{walletId}}"", ""signerWalletId"": ""{{walletId}}"" }"; var content = new StringContent(json, Encoding.UTF8, "application/json");
var request = new HttpRequestMessage(HttpMethod.Delete, "https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/role"); request.Content = content; var response = await client.SendAsync(request); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Role removed: " + responseString); }}
View Roles
Section titled “View Roles”GET /v2/stablecoin/{stablecoinId}/roles
Example Request
Section titled “Example Request”curl -X GET "https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/roles?type=ATTESTATION_MANAGER" \ -H "Authorization: Bearer $FSCO_API_KEY"
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;
const listStablecoinRoles = async () => { const response = await axios.get( 'https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/roles?type=ATTESTATION_MANAGER', { headers: { Authorization: `Bearer ${FSCO_API_KEY}`, 'Content-Type': 'application/json' } } );
console.log('Roles:', response.data);};
listStablecoinRoles();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")
headers = { "Authorization": f"Bearer {FSCO_API_KEY}", "Content-Type": "application/json",}
response = requests.get( "https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/roles?type=ATTESTATION_MANAGER", headers=headers,)
print("Roles:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;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 response = await client.GetAsync("https://api.fsco.io/v2/stablecoin/{{stablecoinId}}/roles?type=ATTESTATION_MANAGER"); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Roles: " + responseString); }}
Supported Roles
Section titled “Supported Roles”Attestation Manager Roles (ATTESTATION_MANAGER
)
Section titled “Attestation Manager Roles (ATTESTATION_MANAGER)”DEFAULT_ADMIN_ROLE
(for managing roles)SUBMITTER_ROLE
(for submitting attestations)VERIFIER_ROLE
(for verifying attestations)
Collateralised Token Roles (COLLATERALISED_TOKEN
)
Section titled “Collateralised Token Roles (COLLATERALISED_TOKEN)”DEFAULT_ADMIN_ROLE
(for managing roles)MINTER_ROLE
(for minting tokens)PAUSER_ROLE
(for pausing the stablecoin)BLACKLISTER_ROLE
(for blacklisting wallets)