Deposit Addresses API
DepositAddress
es 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.
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.
mutation CreateWalletDepositAddress($input: CreateWalletDepositAddressInput!) {
createWalletDepositAddress(input: $input) {
label
address
walletDepositAddressId
}
}
{
"variables": {
"input": {
"walletId": "22cf4347-405a-47df-8267-26bfecac7b11",
"label": "Address 2",
"orgId": "868202983161"
}
}
}
{
"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.
query WalletDepositAddress($walletDepositAddressId: ID!) {
walletDepositAddress(walletDepositAddressId: $walletDepositAddressId) {
label
address
walletDepositAddressId
walletId
}
}
{
"variables": {
"walletDepositAddressId": "01234abc-e382-4d2f-bcea-0b789c00c18b"
}
}
{
"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.
mutation UpdateWalletDepositAddress($input: UpdateWalletDepositAddressInput!) {
updateWalletDepositAddress(input: $input)
}
{
"variables": {
"input": {
"orgId": "868202983161",
"walletId": "22cf4347-405a-47df-8267-26bfecac7b11"
"walletDepositAddressId": "01234abc-e382-4d2f-bcea-0b789c00c18b",
"label": "Updated Address Label"
}
}
}
{
"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.