Wallets

Learn how to programmatically manage connecting your wallet(s) with your StablR Account.

Managing your wallet(s) in your StablR Account is an additional service accessible via the StablR API. On this page we will guide you through the steps how to whitelist a wallet, retrieve an overview of your whitelisted wallet(s), and remove a whitelisted wallet from your StablR Account.


Configure your StablR Account

To programmatically manage wallets you need to make sure you have created an API Key.

Get an API Key

StablR's API uses API Keys and Access Tokens as the mechanism to authenticate customer requests. When have retrieved the Access Token for authentication, this Access Token must be set in the Authorization header of the API request for which the format of the header is Bearer secret-key-value.

How to Create an API Key.

Once you have generated your API key, store it with its respective {CLIENT_SECRET} and the {CLIENT_ID} in a secure place.

To be able to make valid requests from your backend server, you must retrieve an {ACCESS_TOKEN} using the {CLIENT_SECRET} and {CLIENT_ID} as explained in the Authentication section.

📘

API Access Tokens

StablR's Access Tokens for making secure API requests will expire five (5) minutes after creation. This means you have to request a new token after the respective token has expired to keep making valid requests from your backend server.


Whitelist a wallet

To add a wallet to your StablR Account via the API you will need to invoke the Whitelist a Wallet request.

Request

Replace {ACCESS_TOKEN} with the Access Token you retrieved when authenticating your API Key.

Insert the {WALLET_NAME} to add a readable identifier for the wallet you are whitelisting in the StablR Account.

Insert one of the Buy as the Type.

Select one of the options for the Type (i.e. MetaMask Institutional, Fireblocks, etc.)

Select the compatible Network for the wallet (i.e. Ethereum).

Insert the {WALLET_ADDRESS} of the wallet.

curl --request POST \
     --url https://api.stablr.com/v1/customer/wallets \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}' \
     --header 'content-type: application/*+json' \
     --data '
{
  "Name": "{WALLET_NAME}",
  "Type": "MetaMaskInstitutional",
  "Network": "Ethereum",
  "Address": "{WALLET_ADDRESS}"
}
'

Response

The response looks like this:

{
  "WalletId": "2fa85f64-5717-4562-b3fc-2c963f66afa5"
}

📘

Wallet Validation

When adding a wallet to your StablR Account it will be in PENDING status. StablR will verify the whitelisting which will mark it as APPROVED.


Retrieve wallet details

When you want to retrieve the wallets you have registered for whitelisting in your StablR Account, either manually of via the StablR API, you can invoke either the List all Wallets or GET a Wallet requests.

List all Wallets Request

Replace {ACCESS_TOKEN} with the Access Token you retrieved when authenticating your API Key.

curl --request GET \
     --url https://api.stablr.com/v1/customer/wallets \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}'

GET a Wallet Request

Replace {ACCESS_TOKEN} with the Access Token you retrieved when authenticating your API Key.

Replace walletId with the WalletId you retrieve when whitelisting a wallet or when retrieving the list of all your whitelisted wallets.

curl --request GET \
     --url https://api.stablr.com/v1/customer/wallets/walletId \
     --header 'accept: application/json' \
     --header 'authorization: Bearer {ACCESS_TOKEN}'

Response

The response for those requests look like this:

[
  {
    "Id": "2fa85f64-5717-4562-b3fc-2c963f66afa5",
    "Name": "{WALLET_NAME}",
    "Type": "MetaMaskInstitutional",
    "Network": "Ethereum",
    "Address": "{WALLET_ADDRESS}",
    "Status": "Approved",
    "CreatedAt": "2024-05-30T09:16:37.250Z"
  }
]

Remove a whitelisted wallet

To remove a wallet to from StablR Account via the API you will need to invoke the Remove a Wallet request.

Request

Replace {ACCESS_TOKEN} with the Access Token you retrieved when authenticating your API Key.

Replace walletId with the WalletId you retrieve when whitelisting a wallet or when retrieving the list of all your whitelisted wallets.

curl --request DELETE \
     --url https://api.stablr.com/v1/customer/wallets/walletId \
     --header 'authorization: Bearer {ACCESS_TOKEN}'

Response

A successful response returns a HTTPS 200 to your backend server.


What’s Next