Create a Wallet
Creating a wallet is the first step to interacting with blockchain functionality in FSCO. This guide will walk you through the process of creating a wallet using our API.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
- A valid FSCO API key
- Your application’s environment configured with the API key
Endpoint
Section titled “Endpoint”POST /v2/wallet
Request Parameters
Section titled “Request Parameters”{ "name": "Your Wallet Name", "custodian": "fsco"}
The request requires two parameters:
name
: A descriptive name for your walletcustodian
: The custody provider for your wallet"fsco"
: Default option, managed by FSCO"dfns"
: External custody through DFNS (requires additional setup)
Example Request
Section titled “Example Request”curl -X POST https://api.fsco.io/v2/wallet \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Your Wallet Name", "custodian": "fsco" }'
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;const FSCO_API_SECRET = process.env.FSCO_API_SECRET;const createWallet = async () => { const response = await axios.post( 'https://api.fsco.io/v2/wallet', { name: 'Your Wallet Name', custodian: 'fsco', }, { headers: { 'x-api-key': FSCO_API_KEY, 'x-api-secret': FSCO_API_SECRET, 'Content-Type': 'application/json', }, } );
console.log('Wallet created:', response.data);};
createWallet();
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")FSCO_API_SECRET = os.getenv("FSCO_API_SECRET")
headers = { "x-api-key": FSCO_API_KEY, "x-api-secret": FSCO_API_SECRET, "Content-Type": "application/json",}
payload = {"name": "Your Wallet Name", "custodian": "fsco"}
response = requests.post("https://api.fsco.io/v2/wallet", json=payload, headers=headers)
print("Wallet created:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Text;using System.Threading.Tasks;
class WalletCreator{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY");
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var json = "{\"name\": \"Your Wallet Name\", \"custodian\": \"fsco\"}"; var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync("https://api.fsco.io/v2/wallet", content); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Wallet created: " + responseString); }}
Response
Section titled “Response”{ "walletId": "8c1d496f-2827-4750-a11f-74b48c11108d", "name": "My Wallet", "custodian": "fsco", "address": "0x1234567890abcdef"}
Retrieving Wallet Details
Section titled “Retrieving Wallet Details”After creating a wallet, you can retrieve its details using the wallet ID:
curl -X GET https://api.fsco.io/v2/wallet/123e4567-e89b-12d3-a456-426614174000 \ -H "Authorization: Bearer $FSCO_API_KEY" \ -H "Content-Type: application/json"
import axios from 'axios';
const FSCO_API_KEY = process.env.FSCO_API_KEY;const FSCO_API_SECRET = process.env.FSCO_API_SECRET;const getWallet = async (walletId: string) => { const response = await axios.get( `https://api.fsco.io/v2/wallet/${walletId}`, { headers: { 'x-api-key': FSCO_API_KEY, 'x-api-secret': FSCO_API_SECRET, 'Content-Type': 'application/json', }, } );
console.log('Wallet details:', response.data);};
// Example usagegetWallet('123e4567-e89b-12d3-a456-426614174000');
import requestsimport os
FSCO_API_KEY = os.getenv("FSCO_API_KEY")FSCO_API_SECRET = os.getenv("FSCO_API_SECRET")
headers = { "x-api-key": FSCO_API_KEY, "x-api-secret": FSCO_API_SECRET, "Content-Type": "application/json",}
wallet_id = "123e4567-e89b-12d3-a456-426614174000"response = requests.get(f"https://api.fsco.io/v2/wallet/{wallet_id}", headers=headers)
print("Wallet details:", response.json())
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;
class WalletGetter{ static async Task Main() { var apiKey = Environment.GetEnvironmentVariable("FSCO_API_KEY"); var walletId = "123e4567-e89b-12d3-a456-426614174000";
var client = new HttpClient(); client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);
var response = await client.GetAsync($"https://api.fsco.io/v2/wallet/{walletId}"); var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine("Wallet details: " + responseString); }}
Response
Section titled “Response”{ "walletId": "8c1d496f-2827-4750-a11f-74b48c11108d", "name": "My Wallet", "custodian": "fsco", "address": "0x1234567890abcdef"}
Important Notes
Section titled “Important Notes”- Store the
walletId
securely - you’ll need it for all future wallet operations - The wallet address works across all supported EVM chains
- FSCO-native custody (
"fsco"
) is recommended for most use cases - If using DFNS custody, ensure it’s configured in your FSCO dashboard first