Deposit asset
Important:
Request headers are required. See API basics introduction for more information.
What is the deposit address?
The deposit address represents a wallet address of a specific chain belonging to your user. This address is unique per user and per chain and will be generated at the first on-chain action (Create asset or deposit asset).
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 parameter | Description |
---|---|
user_uid | The unique identifier of the user for this app (ex. 813231035224). |
collection_uid | The unique identifier of the collection of this app for which the user deposits its asset |
Response
You will receive the asset details including the following fields:
Response fields | Type | Description | Condition |
---|---|---|---|
network | String | The name of the current app network | Mandatory |
chain_id | Integer | The id of the current app chain id | Mandatory |
wallet_address | String | The user wallet address. Can be null | Mandatory |
qr_code_data | String | The data needed to display a QR code supported by wallets. Follows ERC-681 | Mandatory |
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.
Updated 4 months ago