Deposit asset

🚧

Important:

Request headers are required. See API basics introduction for more information.

What is the deposit address?

The deposit address represents the unique wallet address belonging to your user. This address is unique per user and would have been generated when you create a user.

In the case you allow your users to transfer their assets outside of their in-app wallet to an external wallet, you should also allow users to deposit their assets back to your application. For this you can simply display their 'deposit address'. To do so, you can use the following endpoints:

Get deposit data

Endpoint

GET /deposit?user_uid={uid}

Returns all data needed for users to deposit their asset on Original.

🚧

Important:

It is necessary that you always create a user first before to display a user's deposit address.

Parameters

Query parameters

Query parameterDescription
user_uidThe unique identifier of the user for this app (ex. 813231035224).

Response

You will receive the asset details including the following fields:

Response fieldsTypeDescriptionCondition
networkStringThe name of the current app networkMandatory
chain_idIntegerThe id of the current app chain idMandatory
wallet_addressStringThe user wallet address. Can be nullMandatory
qr_code_dataStringThe data needed to display a QR code supported by wallets. Follows ERC-681Mandatory

Response example

You will receive the list of asset(s) details including the following fields:

{
    "success": true,
    "data": {
        "network": "Amoy",
        "chain_id": 80001,
        "wallet_address": "0x1d6169328e0a2e0a0709115d1860c682cf8d1398",
        "qr_code_data": "ethereum:0x1d6169328e0a2e0a0709115d1860c682cf8d1398@80001"
    }
}

πŸ“˜

Note:

Considering that user wallet creation is asynchronous, the wallet_address will be empty until it is created. See Create User for more information.

To know when the user wallet has been created, you can subscribe to the Webhook events or poll any Get user details endpoint.

Example

The following example retrieves the deposit details for user 111111111111.

# API_KEY is your api key
# TOKEN is the access token generated with your api key secret

curl -i \
  -X GET \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: API_KEY" \
  -H "Authorization: Bearer TOKEN" \
  "https://api.getoriginal.com/v1/deposit?user_uid=111111111111"

Webhook

When an asset has been successfully deposited, you will receive an asset.transferred webhook event. We do not provide a separate webhook event for deposits. See webhook configuration for more details.

Callout

When your users decide to transfer their assets outside of the application, they are leaving your app ecosystem and are fully responsible for what they do with their assets. When depositing assets back to their wallet they must ensure:

  • that they are sending it to the right wallet address
  • that they are sending it through the correct network

❗️

If a user deposits asset(s) using a wrong network or a wrong wallet address, the asset(s) might be lost forever. Original can't do anything about this and is not responsible for the loss of these assets.

Design example in your app

Here is an example of what the deposit address view could look like.

πŸ“˜

Note:

This screenshot is for informative purposes only.