Add an asset to an external wallet.
Adds an asset to an existing external wallet. Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor.
POST
/
external_wallets
/
{walletId}
/
{assetId}
TypeScript
const response: Promise<FireblocksResponse<ExternalWalletAsset>> = fireblocks.externalWallets.addAssetToExternalWallet(externalWalletsApiAddAssetToExternalWalletRequest);CompletableFuture<ApiResponse<ExternalWalletAsset>> response = fireblocks.externalWallets().addAssetToExternalWallet(walletId, assetId, addAssetToExternalWalletRequest, idempotencyKey);response = fireblocks.external_wallets.add_asset_to_external_wallet(wallet_id, asset_id, add_asset_to_external_wallet_request, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/external_wallets/{walletId}/{assetId} \
--header 'Content-Type: application/json' \
--data '
{
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"tag": "12345"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({address: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', tag: '12345'})
};
fetch('https://api.fireblocks.io/v1/external_wallets/{walletId}/{assetId}', 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.fireblocks.io/v1/external_wallets/{walletId}/{assetId}",
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([
'address' => '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
'tag' => '12345'
]),
CURLOPT_HTTPHEADER => [
"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.fireblocks.io/v1/external_wallets/{walletId}/{assetId}"
payload := strings.NewReader("{\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n \"tag\": \"12345\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/external_wallets/{walletId}/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n \"tag\": \"12345\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "WAITING_FOR_APPROVAL",
"address": "<string>",
"balance": 123,
"lockedAmount": 123,
"tag": "<string>",
"activationTime": "<string>",
"additionalInfo": [
{
"accountHolderGivenName": "<string>",
"accountHolderSurname": "<string>",
"accountHolderCity": "<string>",
"accountHolderCountry": "<string>",
"accountHolderAddress1": "<string>",
"accountHolderAddress2": "<string>",
"accountHolderDistrict": "<string>",
"accountHolderPostalCode": "<string>",
"abaRoutingNumber": "<string>",
"abaAccountNumber": "<string>",
"abaCountry": "<string>",
"iban": "<string>",
"ibanCity": "<string>",
"ibanCountry": "<string>",
"speiClabe": "<string>",
"speiName": "<string>"
}
]
}{
"message": "<string>",
"code": 123
}Headers
Path Parameters
Body
application/json
- Option 1
- Option 2
Request schema for adding an asset to an external wallet
Was this page helpful?
⌘I
TypeScript
const response: Promise<FireblocksResponse<ExternalWalletAsset>> = fireblocks.externalWallets.addAssetToExternalWallet(externalWalletsApiAddAssetToExternalWalletRequest);CompletableFuture<ApiResponse<ExternalWalletAsset>> response = fireblocks.externalWallets().addAssetToExternalWallet(walletId, assetId, addAssetToExternalWalletRequest, idempotencyKey);response = fireblocks.external_wallets.add_asset_to_external_wallet(wallet_id, asset_id, add_asset_to_external_wallet_request, idempotency_key);curl --request POST \
--url https://api.fireblocks.io/v1/external_wallets/{walletId}/{assetId} \
--header 'Content-Type: application/json' \
--data '
{
"address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa",
"tag": "12345"
}
'const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({address: '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', tag: '12345'})
};
fetch('https://api.fireblocks.io/v1/external_wallets/{walletId}/{assetId}', 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.fireblocks.io/v1/external_wallets/{walletId}/{assetId}",
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([
'address' => '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa',
'tag' => '12345'
]),
CURLOPT_HTTPHEADER => [
"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.fireblocks.io/v1/external_wallets/{walletId}/{assetId}"
payload := strings.NewReader("{\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n \"tag\": \"12345\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}require 'uri'
require 'net/http'
url = URI("https://api.fireblocks.io/v1/external_wallets/{walletId}/{assetId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"address\": \"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa\",\n \"tag\": \"12345\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "WAITING_FOR_APPROVAL",
"address": "<string>",
"balance": 123,
"lockedAmount": 123,
"tag": "<string>",
"activationTime": "<string>",
"additionalInfo": [
{
"accountHolderGivenName": "<string>",
"accountHolderSurname": "<string>",
"accountHolderCity": "<string>",
"accountHolderCountry": "<string>",
"accountHolderAddress1": "<string>",
"accountHolderAddress2": "<string>",
"accountHolderDistrict": "<string>",
"accountHolderPostalCode": "<string>",
"abaRoutingNumber": "<string>",
"abaAccountNumber": "<string>",
"abaCountry": "<string>",
"iban": "<string>",
"ibanCity": "<string>",
"ibanCountry": "<string>",
"speiClabe": "<string>",
"speiName": "<string>"
}
]
}{
"message": "<string>",
"code": 123
}