curl --request GET \
--url https://test.deribit.com/api/v2/private/add_to_address_book \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 42,
"method": "private/add_to_address_book",
"params": {
"currency": "BTC",
"type": "withdrawal",
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj",
"label": "Main address",
"beneficiary_vasp_name": "Money`s Gone",
"beneficiary_vasp_did": "did:example:123456789abcdefghi",
"beneficiary_first_name": "John",
"beneficiary_last_name": "Doe",
"beneficiary_address": "NL, Amsterdam, Street, 1",
"agreed": true,
"personal": false
}
}
'import requests
url = "https://test.deribit.com/api/v2/private/add_to_address_book"
payload = {
"jsonrpc": "2.0",
"id": 42,
"method": "private/add_to_address_book",
"params": {
"currency": "BTC",
"type": "withdrawal",
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj",
"label": "Main address",
"beneficiary_vasp_name": "Money`s Gone",
"beneficiary_vasp_did": "did:example:123456789abcdefghi",
"beneficiary_first_name": "John",
"beneficiary_last_name": "Doe",
"beneficiary_address": "NL, Amsterdam, Street, 1",
"agreed": True,
"personal": False
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 42,
method: 'private/add_to_address_book',
params: {
currency: 'BTC',
type: 'withdrawal',
address: 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj',
label: 'Main address',
beneficiary_vasp_name: 'Money`s Gone',
beneficiary_vasp_did: 'did:example:123456789abcdefghi',
beneficiary_first_name: 'John',
beneficiary_last_name: 'Doe',
beneficiary_address: 'NL, Amsterdam, Street, 1',
agreed: true,
personal: false
}
})
};
fetch('https://test.deribit.com/api/v2/private/add_to_address_book', 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://test.deribit.com/api/v2/private/add_to_address_book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 42,
'method' => 'private/add_to_address_book',
'params' => [
'currency' => 'BTC',
'type' => 'withdrawal',
'address' => 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj',
'label' => 'Main address',
'beneficiary_vasp_name' => 'Money`s Gone',
'beneficiary_vasp_did' => 'did:example:123456789abcdefghi',
'beneficiary_first_name' => 'John',
'beneficiary_last_name' => 'Doe',
'beneficiary_address' => 'NL, Amsterdam, Street, 1',
'agreed' => true,
'personal' => false
]
]),
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://test.deribit.com/api/v2/private/add_to_address_book"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 42,\n \"method\": \"private/add_to_address_book\",\n \"params\": {\n \"currency\": \"BTC\",\n \"type\": \"withdrawal\",\n \"address\": \"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj\",\n \"label\": \"Main address\",\n \"beneficiary_vasp_name\": \"Money`s Gone\",\n \"beneficiary_vasp_did\": \"did:example:123456789abcdefghi\",\n \"beneficiary_first_name\": \"John\",\n \"beneficiary_last_name\": \"Doe\",\n \"beneficiary_address\": \"NL, Amsterdam, Street, 1\",\n \"agreed\": true,\n \"personal\": false\n }\n}")
req, _ := http.NewRequest("GET", 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))
}HttpResponse<String> response = Unirest.get("https://test.deribit.com/api/v2/private/add_to_address_book")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 42,\n \"method\": \"private/add_to_address_book\",\n \"params\": {\n \"currency\": \"BTC\",\n \"type\": \"withdrawal\",\n \"address\": \"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj\",\n \"label\": \"Main address\",\n \"beneficiary_vasp_name\": \"Money`s Gone\",\n \"beneficiary_vasp_did\": \"did:example:123456789abcdefghi\",\n \"beneficiary_first_name\": \"John\",\n \"beneficiary_last_name\": \"Doe\",\n \"beneficiary_address\": \"NL, Amsterdam, Street, 1\",\n \"agreed\": true,\n \"personal\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/private/add_to_address_book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 42,\n \"method\": \"private/add_to_address_book\",\n \"params\": {\n \"currency\": \"BTC\",\n \"type\": \"withdrawal\",\n \"address\": \"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj\",\n \"label\": \"Main address\",\n \"beneficiary_vasp_name\": \"Money`s Gone\",\n \"beneficiary_vasp_did\": \"did:example:123456789abcdefghi\",\n \"beneficiary_first_name\": \"John\",\n \"beneficiary_last_name\": \"Doe\",\n \"beneficiary_address\": \"NL, Amsterdam, Street, 1\",\n \"agreed\": true,\n \"personal\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 42,
"result": {
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj",
"creation_timestamp": 1536569522277,
"currency": "BTC",
"type": "withdrawal",
"label": "Main address",
"beneficiary_vasp_name": "Money`s Gone",
"beneficiary_vasp_did": "did:example:123456789abcdefghi",
"beneficiary_first_name": "John",
"beneficiary_last_name": "Doe",
"beneficiary_address": "NL, Amsterdam, Street, 1",
"agreed": true,
"personal": false,
"info_required": false
}
}private/add_to_address_book
Adds a new address to the address book. The address book allows you to store addresses for withdrawals, along with beneficiary information for compliance purposes.
Coinbase wallet type
For Coinbase wallet type accounts the method supports network selection and CTN (Coinbase Travel Network) counterparties, and behaves differently:
- Required parameters are
typeandlabel, plus one of:addresstogether withcurrencyandnetwork(optionaltag) โ an on-chain address on the selected network, orcounterparty_idโ a CTN counterparty;currencyis then omitted and the entry applies to all currencies.
typeaccepts onlywithdrawalandtransfer.- Travel rule data is provided with the fields
name,country,address,financial_institution,account,account_location,entity_type(organizationorindividual),wallet_type(exchangeorself_hosted) andis_selfinstead of the legacybeneficiary_*,agreedandpersonalfields. extra_currenciesis not supported.- The response contains a Coinbase address book entry object, including the entry
idwhich can be used instead ofaddressin the other address book methods.
๐ Related Article: Managing Withdrawals
Scope: wallet:read_write
curl --request GET \
--url https://test.deribit.com/api/v2/private/add_to_address_book \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"id": 42,
"method": "private/add_to_address_book",
"params": {
"currency": "BTC",
"type": "withdrawal",
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj",
"label": "Main address",
"beneficiary_vasp_name": "Money`s Gone",
"beneficiary_vasp_did": "did:example:123456789abcdefghi",
"beneficiary_first_name": "John",
"beneficiary_last_name": "Doe",
"beneficiary_address": "NL, Amsterdam, Street, 1",
"agreed": true,
"personal": false
}
}
'import requests
url = "https://test.deribit.com/api/v2/private/add_to_address_book"
payload = {
"jsonrpc": "2.0",
"id": 42,
"method": "private/add_to_address_book",
"params": {
"currency": "BTC",
"type": "withdrawal",
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj",
"label": "Main address",
"beneficiary_vasp_name": "Money`s Gone",
"beneficiary_vasp_did": "did:example:123456789abcdefghi",
"beneficiary_first_name": "John",
"beneficiary_last_name": "Doe",
"beneficiary_address": "NL, Amsterdam, Street, 1",
"agreed": True,
"personal": False
}
}
headers = {"Content-Type": "application/json"}
response = requests.get(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
id: 42,
method: 'private/add_to_address_book',
params: {
currency: 'BTC',
type: 'withdrawal',
address: 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj',
label: 'Main address',
beneficiary_vasp_name: 'Money`s Gone',
beneficiary_vasp_did: 'did:example:123456789abcdefghi',
beneficiary_first_name: 'John',
beneficiary_last_name: 'Doe',
beneficiary_address: 'NL, Amsterdam, Street, 1',
agreed: true,
personal: false
}
})
};
fetch('https://test.deribit.com/api/v2/private/add_to_address_book', 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://test.deribit.com/api/v2/private/add_to_address_book",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS => json_encode([
'jsonrpc' => '2.0',
'id' => 42,
'method' => 'private/add_to_address_book',
'params' => [
'currency' => 'BTC',
'type' => 'withdrawal',
'address' => 'bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj',
'label' => 'Main address',
'beneficiary_vasp_name' => 'Money`s Gone',
'beneficiary_vasp_did' => 'did:example:123456789abcdefghi',
'beneficiary_first_name' => 'John',
'beneficiary_last_name' => 'Doe',
'beneficiary_address' => 'NL, Amsterdam, Street, 1',
'agreed' => true,
'personal' => false
]
]),
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://test.deribit.com/api/v2/private/add_to_address_book"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"id\": 42,\n \"method\": \"private/add_to_address_book\",\n \"params\": {\n \"currency\": \"BTC\",\n \"type\": \"withdrawal\",\n \"address\": \"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj\",\n \"label\": \"Main address\",\n \"beneficiary_vasp_name\": \"Money`s Gone\",\n \"beneficiary_vasp_did\": \"did:example:123456789abcdefghi\",\n \"beneficiary_first_name\": \"John\",\n \"beneficiary_last_name\": \"Doe\",\n \"beneficiary_address\": \"NL, Amsterdam, Street, 1\",\n \"agreed\": true,\n \"personal\": false\n }\n}")
req, _ := http.NewRequest("GET", 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))
}HttpResponse<String> response = Unirest.get("https://test.deribit.com/api/v2/private/add_to_address_book")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"id\": 42,\n \"method\": \"private/add_to_address_book\",\n \"params\": {\n \"currency\": \"BTC\",\n \"type\": \"withdrawal\",\n \"address\": \"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj\",\n \"label\": \"Main address\",\n \"beneficiary_vasp_name\": \"Money`s Gone\",\n \"beneficiary_vasp_did\": \"did:example:123456789abcdefghi\",\n \"beneficiary_first_name\": \"John\",\n \"beneficiary_last_name\": \"Doe\",\n \"beneficiary_address\": \"NL, Amsterdam, Street, 1\",\n \"agreed\": true,\n \"personal\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://test.deribit.com/api/v2/private/add_to_address_book")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"id\": 42,\n \"method\": \"private/add_to_address_book\",\n \"params\": {\n \"currency\": \"BTC\",\n \"type\": \"withdrawal\",\n \"address\": \"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj\",\n \"label\": \"Main address\",\n \"beneficiary_vasp_name\": \"Money`s Gone\",\n \"beneficiary_vasp_did\": \"did:example:123456789abcdefghi\",\n \"beneficiary_first_name\": \"John\",\n \"beneficiary_last_name\": \"Doe\",\n \"beneficiary_address\": \"NL, Amsterdam, Street, 1\",\n \"agreed\": true,\n \"personal\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 42,
"result": {
"address": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj",
"creation_timestamp": 1536569522277,
"currency": "BTC",
"type": "withdrawal",
"label": "Main address",
"beneficiary_vasp_name": "Money`s Gone",
"beneficiary_vasp_did": "did:example:123456789abcdefghi",
"beneficiary_first_name": "John",
"beneficiary_last_name": "Doe",
"beneficiary_address": "NL, Amsterdam, Street, 1",
"agreed": true,
"personal": false,
"info_required": false
}
}Query Parameters
The currency symbol. Required for legacy wallet type (wallet currencies only). Coinbase wallet type: required when address is used (any portfolio currency); omitted when adding a CTN counterparty via counterparty_id โ such entries apply to all currencies ("all").
Currency, i.e "BTC", "ETH", "USDC"
BTC, ETH, USDC, USDT, EURR "BTC"
Address book type
transfer, withdrawal, deposit_source "withdrawal"
Address in currency format. Required for legacy wallet type. Coinbase wallet type: required when counterparty_id is not provided, and must then be used together with currency and network (and tag for networks that require one). For Coinbase wallet type the same value is also stored as the beneficiary address travel rule field.
Address in proper format for currency
"bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf0uyj"
Blockchain network for the wallet operation, given as a network resource name (e.g. "networks/ethereum-mainnet"). Coinbase wallet type only. The networks available for each currency are returned by public/get_currencies in the coinbase_networks field. Required for operations that target an on-chain address or a deposit address; also used to disambiguate address book entries when the same address exists on multiple networks.
"networks/ethereum-mainnet"
Destination tag / memo for networks that support one. Coinbase wallet type only. Used together with address and network; also serves to disambiguate address book entries that share the same address.
Identifier of a Coinbase Travel Network (CTN) counterparty. Coinbase wallet type only. Used instead of address and network; entries created with counterparty_id apply to all currencies, so currency is omitted.
"cp-8f3e2a1b9c4d"
Label of the address book entry
"Main address"
Name of beneficiary VASP
"Moneys Gone"`
DID of beneficiary VASP
"did:example:123456789abcdefghi"
Website of the beneficiary VASP
First name of beneficiary (if beneficiary is a person) First name of the beneficiary (if beneficiary is a person)
"John"
First name of beneficiary (if beneficiary is a person) Last name of the beneficiary (if beneficiary is a person)
"Doe"
Beneficiary company name (if beneficiary is a company) Company name of the beneficiary (if beneficiary is a company)
"Company Name"
Geographical address of the beneficiary
"NL, Amsterdam, Street, 1"
Indicates that the user agreed to shared provided information with 3rd parties
true
The user confirms that he provided address belongs to him and he has access to it via an un-hosted wallet software
false
The user can pass a list of currencies to add the address for. It is currently available ONLY for ERC20 currencies. Without passing this paramater for an ERC20 currency, the address will be added to ALL of the ERC20 currencies.
Name of the currency
["USDC"]
Full name of the beneficiary (person or organization). Coinbase wallet type only โ travel rule data.
"Alice Smith"
Country code of the beneficiary (ISO 3166-1 alpha-2). Coinbase wallet type only โ travel rule data.
"NL"
Name of the financial institution holding the beneficiary account. Coinbase wallet type only โ travel rule data.
Account identifier of the beneficiary at the financial institution. Coinbase wallet type only โ travel rule data.
Location of the beneficiary account. Coinbase wallet type only โ travel rule data.
Type of the beneficiary entity. Coinbase wallet type only โ travel rule data.
organization, individual Type of the beneficiary wallet. Coinbase wallet type only โ travel rule data.
exchange, self_hosted Indicates that the beneficiary is the account owner. Coinbase wallet type only โ travel rule data.
Response
Success response
The JSON-RPC version (2.0)
2.0 - Option 1
- Option 2
Hide child attributes
Hide child attributes
Currency, i.e "BTC", "ETH", "USDC"
BTC, ETH, STETH, ETHW, USDC, USDT, EURR, SOL, XRP, USYC, PAXG, BNB, USDE Address in proper format for currency
"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa"
The timestamp (milliseconds since the Unix epoch)
1536569522277
Address book type
transfer, withdrawal, deposit_source Label of the address book entry
"Main address"
Name of beneficiary VASP
"Money's Gone"
DID of beneficiary VASP
"did:example:123456789abcdefghi"
Website of the beneficiary VASP
First name of the beneficiary (if beneficiary is a person)
"John"
Last name of the beneficiary (if beneficiary is a person)
"Doe"
Company name of the beneficiary (if beneficiary is a company)
"Company Name"
Geographical address of the beneficiary
"NL, Amsterdam, Street, 1"
Indicates that the user agreed to shared provided information with 3rd parties
true
The user confirms that he provided address belongs to him and he has access to it via an un-hosted wallet software
true
Signalises that addition information regarding the beneficiary of the address is required
true
Wallet address status, values: [admin_locked, waiting, confirmed, ready]
admin_locked, waiting, confirmed, ready Timestamp when the address will be ready
true
If address requires email confirmation for withdrawals
true
If email confirmation change is in progress
true
If withdrawals to this address require a security key
false
The id that was sent in the request
Was this page helpful?