Deposit Addresses API

DepositAddresses are blockchain addresses that are generated for your users to deposit digital assets into your wallet. Within Levain, every main wallet created will always have the ability to generate deposit addresses. Visually, they are represented as a list of addresses within a wallet.

graph TD; U1[User 1] -->|Transfer| A1[Deposit Address 1\n0xAbc...123\nLevain] U2[User 2] -->|Transfer| A2[Deposit Address 2\n0xBcd...a1D\nLevain] U3[User 3] -->|Transfer| A3[Deposit Address 3\n0xEfa...01C\nLevain] Un[User n] -->|Transfer| An[Deposit Address n\n0xBcd...2ad\nLevain] A1 --->|Consolidate| B[Customer Funds Wallet\n0xC1a...882\nLevain] A2 --->|Consolidate| B A3 --->|Consolidate| B An --->|Consolidate| B B -->|Overflow| C[Cold Wallet\n0xD2b...7ab\nLevain] B -->|Withdraw| D[Withdrawal Addresses] subgraph "Levain Omnibus Structure" A1 A2 A3 An B C end

Create

You can create a wallet using the following GraphQL mutation with the CreateWalletInput input. It requires walletId, label and orgId as inputs. The walletId is the walletId of the wallet that you should have created using the CreateWallet mutation, and the label is the label of the deposit address that you want to create.

MutationGraphQL
mutation CreateWalletDepositAddress($input: CreateWalletDepositAddressInput!) {
  createWalletDepositAddress(input: $input) {
    label
    address
    walletDepositAddressId
  }
}
VariablesJSON
{
  "variables": {
    "input": {
      "walletId": "22cf4347-405a-47df-8267-26bfecac7b11",
      "label": "Address 2",
      "orgId": "868202983161"
    }
  }
}
ResponseJSON
{
  "data": {
    "createWalletDepositAddress": {
      "label": "Address 2",
      "address": "0x55debd6128bb2fde649b50752a60e1e3452b6304",
      "walletDepositAddressId": "01234abc-e382-4d2f-bcea-0b789c00c18b"
    }
  }
}

Retrieve

By Deposit Address ID

We are currently working on the following feature.

You can retrieve details of a specific deposit address using the walletDepositAddress query. This query requires the walletDepositAddressId as an input and returns details related to the specified deposit address.

QueryGraphQL
query WalletDepositAddress($walletDepositAddressId: ID!) {
  walletDepositAddress(walletDepositAddressId: $walletDepositAddressId) {
    label
    address
    walletDepositAddressId
    walletId
  }
}
VariablesJSON
{
  "variables": {
    "walletDepositAddressId": "01234abc-e382-4d2f-bcea-0b789c00c18b"
  }
}
ResponseJSON
{
  "data": {
    "walletDepositAddress": {
      "label": "Address 2",
      "address": "0x123...abc",
      "walletDepositAddressId": "01234abc-e382-4d2f-bcea-0b789c00c18b",
      "walletId": "22cf4347-405a-47df-8267-26bfecac7b11"
    }
  }
}

Update

Deposit Addresses within Levain can only have their labels updated. Use the updateWalletDepositAddress mutation with the UpdateWalletDepositAddressInput input. The only fields that can be updated are walletDepositAddressId and label.

MutationGraphQL
mutation UpdateWalletDepositAddress($input: UpdateWalletDepositAddressInput!) {
  updateWalletDepositAddress(input: $input)
}
VariablesJSON
{
  "variables": {
    "input": {
      "orgId": "868202983161",
      "walletId": "22cf4347-405a-47df-8267-26bfecac7b11"
      "walletDepositAddressId": "01234abc-e382-4d2f-bcea-0b789c00c18b",
      "label": "Updated Address Label"
    }
  }
}
ResponseJSON
{
  "data": {
    "updateWalletDepositAddress": true
  }
}

Delete

Due to the immutable nature of blockchain technology, deposit addresses cannot be deleted once they are created. If there are changes or updates needed, consider updating the label of the deposit address for better identification and management. For any other concerns or requirements, please reach out to Levain support for assistance.