Ramp Accounts

Ramp Account syncs balance of assets and liabilities.

Use Ramps to enable on-chain deposits and withdrawals.

Withdrawal is always done from ramp.address even if there are multiple deposit Addresses assigned. All incoming transactions deposited to other addresses are automatically forwarded to ramp.address. In this case, balance received on Ramp is diminished for on-chain fee value applied to internal transfer Deposit Address -> Ramp Address.

When incoming deposit is received on Virtual Account's address, assets will be forwarded to Ramp's ramp.address, following the liabilities balance movement from Ramp -> Virtual Account.

Vice versa, withdrawal created for Virtual Account will move liabilities balance Virtual Account -> Ramp account, following the asset withdrawal from Ramp Account's ramp.address to destination address.

Ramp accounts and Deposit accounts are holding 3 or 4 types of balances. In case when asset is native cryptocurrency, accounts will have 2 off chain balances, available and total, and 1 on chain balance, assets. Additionally if account asset is ERC20, BEP20 or TRC20 token, there will be additional balance, gas, with amount of available native tokens to pay blockchain gas fees for withdrawal process.

Create Ramp Account

Parameters


curl --location --request POST 'https://api.orangepill.cloud/v1/accounts' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffdb' \
--header 'Content-Type: application/json' \
--data-raw '{
    "holder": "634b56217f6a7b0be52dffbd",
    "asset": "BTC",
    "type": "ramp",
    "data": {
        "description": "Cummulative BTC account.",
        "external_reference": "IBAN002"
    }
}'

In response we get new Ramp Account

ramp.address is main address for deposits and withdrawals.

ramp.assets is balance of assets on ramp.address available for withdrawal.

{
    "id": "634b56217f6a7b0be52dffaa",
    "holder": "634b56217f6a7b0be52dffbd",
    "asset": "BTC",
    "type": "ramp",
    "data": {
        "description": "Cummulative BTC account.",
        "external_reference": "IBAN002"
    },
    "currency": "USD",
    "country": "US",
    "balance": {
        "available": 0,
        "total": 0,
        "assets": 0
    },
    "ramp": {
        "address": "634b56217f6a7b0be52dffab",
    },
    "reference": "6b0be52dffcc34b56217f6a7",    
    "active": "false",
    "frozen": "false",
    "created_at": "1519211809934",
    "error": null
}

Connect Virtual Account to Ramp Account

Adding a field ramp will connect Virtual account to Ramp account.


curl --location --request POST 'https://api.orangepill.cloud/v1/accounts \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'idempotency-key: 27373fabc392933deffdc' \
--header 'Content-Type: application/json' \
--data-raw '{
    "holder": "634b56217f6a7b0be52dffbd",
    "asset": "BTC",
    "type": "virtual",
    "ramp": "689ba7b0be52dffbd56217aa",
    "data": {
        "description": "BTC account of John Doe",
        "external_reference": "IBAN003"
    },
}'

In response we get new Virtual Account

ramp is reference to a Ramp that will handle deposits and withdraws for Virtual Account.

{
    "id": "634b56217f6a7b0be52dffca",
    "holder": "634b56217f6a7b0be52dffbd",
    "asset": "BTC",
    "type": "virtual",
    "data": {
        "description": "BTC account of John Doe",
        "external_reference": "IBAN003"
    },
    "currency": "USD",
    "country": "US",
    "balance": {
        "available": 0,
        "total": 0
    },
    "ramp": "634b56217f6a7b0be52dffaa",
    "reference": "6b0be52dffcc34b56217f6a7",    
    "active": "false",
    "frozen": "false",
    "created_at": "1519211809934",
    "error": null
}

Deposit to Ramp account

On-chain deposits can be sent to default Ramp address. After deposit is received and processed, all balances of ramp account will be increased for amount received. To get blockchain address to receive on-chain transactions, populate address details with populate=address querystring parameters.

echo 'populate address details for ramp account'

curl --location --request GET 'https://api.orangepill.cloud/v1/account/634b56217f6a7b0be52dffbd?populate=address' \
--header 'x-api-key: AXVubzpwQDU1dzByYM==' \
--header 'Content-Type: application/json'

In response you will get full address details. In this example blockchain address is "address": "0x4e5ac860ee4c2db16a3bd4450bdeb21e14cf281e".

{
    "id": "63ab92d694bdaeb815cb4365",
    "asset": "ETH",
    "chain": "ethereum",
    "data": null,
    "holder": "639675ab191e9023f356dfa7",
    "currency": "USD",
    "type": "ramp",
    "testnet": false,
    "reference": "63ab92d611da79ce37322335",
    "subscription": "63ab92d750dede50c4c7e6af",
    "balance": {
        "available": 0,
        "total": 0,
        "assets": 0
    },
    "ramp": null,
    "owner": "639675ab191e9023f356dfa6",
    "created_at": 1672188630240,
    "error": null,
    "active": true,
    "frozen": false,
    "deleted": false,
    "address": {
        "id": "63ab92d794bdaeb815cb4367",
        "account": "63ab92d694bdaeb815cb4365",
        "data": null,
        "asset": "ETH",
        "address": "0x4e5ac860ee4c2db16a3bd4450bdeb21e14cf281e",
        "derivation_key": "1",
        "xpub": "xpub6ET1YuT1WEHNzdyoBYMhYScEZMTSBRixirKAps5FJcBTz2KNq2eRsRzEKQvmLearYNe9JXHpLFuPfYokQvr9emohL7ZQuo7U4CSBswYzZfw",
        "destination_tag": null,
        "memo": null,
        "message": null,
        "notification": null,
        "created_at": 1672188631469,
        "error": null
    }
}

Last updated