Wallets

Wallets allow you to hold stablecoins in custodial wallets using Bridge APIs.

Bridge leverages our licenses and technical infrastructure to provide an easy and safe way for you to custody crypto. No external integrations required.

The key functionality of our custodial wallets includes:

  • Creating individual wallets on behalf of your users.
  • Creating wallets for your company or treasury.
  • Transferring in and out of Bridge wallets.
  • Transferring stablecoins between different Bridge wallets.
  • Querying balance for each wallet and for across all wallets.

Example Implementation


Requirements

  • You must use orchestration to on and offramp funds held in Bridge custodial wallets.
  • The flow of funds will need to be approved by Bridge’s legal and compliance departments before access is granted.
  • All funds in custodial wallets will be held in USDB (Bridge's treasury backed stablecoin).
  • Wallets are currently not available for US or European users due to regulatory requirements. Otherwise wallets are supported in all Geographies

Wallet Functionality

All API requests require Idempotency-Key and Api-Key headers.

Create Wallet

Allows you to create new wallets for each of your users. All custodial wallet users must have their country on file with Bridge. If in the US, they must also have their state on file with Bridge.

If you want to create a wallet for yourselves, create a customer id that represents you and then use it to create wallets.

Request

curl --request POST \
     --url https://api.bridge.xyz/v0/customers/customerId/wallets \
     --header 'Api-Key: <API Key>' \
     --header 'Idempotency-Key: <Unique Idempotency Key>' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "chain": "solana"
}

Response

{
  "id": "uuid",
  "chain": "solana",
  "address": "the-blockchain-address",
  "created_at": "2024-09-01T02:03:04.567Z",
  "updated_at": "2024-09-01T02:03:04.567Z"
}

Make sure to save the wallet details, particularly id and address. You'll need them to execute transactions and the GET endpoint is not yet live.

Wallet Balance

Allows you to get the balance of an individual wallet.

Request

curl --request GET  
     --url <https://api.bridge.xyz/v0/customers/customerId/wallets/walletId>  
     --header 'Api-Key: <API Key>'  
     --header 'accept: application/json'

Response

{  
  "id": "uuid",  
  "chain": "solana",  
  "address": "the-blockchain-address",  
  "created_at": "2024-09-01T02:03:04.567Z",  
  "updated_at": "2024-09-01T02:03:04.567Z",  
  "balances": [  
    {  
      "currency": "usdb",  
      "contract_address": "ENL66PGy8d8j5KNqLtCcg4uidDUac5ibt45wbjH9REzB",  
      "balance": "123.456789"  
    }  
  ]  
}

Total Wallets Balance

Allows you to get the total balance of all the wallets associated with your developer id.

Request

curl --request GET  
     --url <https://api.bridge.xyz/v0/wallets/total_balances>  
     --header 'Api-Key: <API Key>'  
     --header 'accept: application/json'

Response

[  
  {  
    "currency": "usdb",  
    "balance": "123.456789"  
  }  
]

Wallet Orchestration

Virtual Account to Wallet

Allows you to onramp from a virtual account to a Bridge Wallet. For more information please read Virtual Accounts

Request

curl --request POST \
     --url https://api.bridge.xyz/v0/customers/customerID/virtual_accounts \
     --header 'Api-Key: <API Key>' \
     --header 'Idempotency-Key: <Unique Idempotency Key>' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "source": {
    "currency": "usd"
  },
  "destination": {
    "currency": "usdb",
    "payment_rail": "solana",
    "address": "the-wallet-blockchain-address"
  }
}

Transfer to Wallet

Allows you to transfer fiat & crypto to your wallet. For more information please read Transfers

curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--data-raw '{
  "amount": "10.0",
  "on_behalf_of": "cust_alice",
  "developer_fee": "0.5",
  "source": {
    "payment_rail": "wire",
    "currency": "usd",
  },
  "destination": {
    "payment_rail": "solana",
    "currency": "usdb",
    "to_address": "the-wallet-blockchain-address"
  },
}'

Transfer from Wallet

Allows you to transfer USDB from your wallet to fiat & crypto. For more information please read Transfers

curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--data-raw '{
  "amount": "10.0",
  "on_behalf_of": "cust_alice",
  "developer_fee": "0.5",
  "source": {
    "payment_rail": "bridge_wallet",
    "currency": "usdb",
    "bridge_wallet_id": "the-wallet-uuid"
  },
  "destination": {
    "payment_rail": "ethereum",
    "currency": "usdc",
    "to_address": "0xdeadbeef",
  },
}'

Liquidation Address to Wallet

Allows you to configure a liquidation address (permanent payment route) to your Bridge Wallet. For more information please read Liquidation Address

curl --location --request POST 'https://api.bridge.xyz/v0/customers/cust_alice/liquidation_addresses' \
--header 'Content-Type: application/json' \
--header 'Api-Key: <Api-Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--data-raw '{
  "chain": "ethereum",
  "currency": "usdt",
  "destination_payment_rail": "solana",
  "destination_currency": "usdb",
  "destination_address": "the-wallet-blockchain-address"
}'

Transfer Between Bridge Wallets

Allows you to transfer USDB between two Bridge Wallets.

curl --location --request POST 'https://api.bridge.xyz/v0/transfers' \
--header 'Api-Key: <API Key>' \
--header 'Idempotency-Key: <Unique Idempotency Key>' \
--data-raw '{
  "amount": "10.0",
  "on_behalf_of": "cust_alice",
  "developer_fee": "0.5",
  "source": {
    "payment_rail": "bridge_wallet",
    "currency": "usdb",
    "bridge_wallet_id": "the-wallet-uuid"
  },
  "destination": {
    "payment_rail": "solana",
    "currency": "usdb",
    "to_address": "the-other-wallet-blockchain-address",
  },
}'