Skip to main content

Account

GET /v1/user/accounts

Get list of user accounts.

curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/accounts"

Request

No parameters for this endpoint.

Response Body

NameTypeDescription
accountsarray of objectList of account objects
└ accountIdintegerUnique ID for each of the user's current & trading accounts assigned by ETHGas
└ userIdintegerUnique ID for the user, assigned by ETHGas
└ typeintegerAccount type: 1 for current account, 2 for preconf trading account
└ namestringAccount name
└ statusintegerAccount status: All active accounts have status 1
└ updateDateintegerDatetime (in UNIX time) last calculated
└ tokensobject[]List of tokens in account
└└ accountIdintegerUnique ID for each of the user's current & trading accounts
└└ tokenIdintegerETHGas Token ID (see Token IDs)
└└ quantitystringAmount of token in account in USD
└└ lockedQuantitystringAmount covering pending limit orders
└└ codestringToken code
└└ availableQuantitystringAvailable quantity for collateral or transfer

Example Response

{
"success": true,
"data": {
"accounts": [
{
"accountId": 127,
"userId": 31,
"type": 1,
"name": "Current",
"status": 1,
"updateDate": 1672903708000,
"tokens": [
{
"accountId": 127,
"tokenId": 1,
"quantity": "0.01",
"lockedQuantity": "0",
"code": "ETH",
"availableQuantity": "0.01"
}
]
},
{
"accountId": 128,
"userId": 31,
"type": 2,
"name": "Preconf",
"status": 1,
"updateDate": 1697445293000,
"tokens": [
{
"accountId": 128,
"tokenId": 1,
"quantity": "9999993311.53",
"lockedQuantity": "1.5628",
"code": "ETH",
"availableQuantity": "9999993309.97"
}
]
}
]
}
}

GET /v1/user/account/:accountId

Get account details for a given account ID.

curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/account/128"

Request

ParameterRequiredTypeDescription
accountIdYESintegerAccount ID

Response Body

NameTypeDescription
accountobjectAccount object
└ accountIdintegerUnique ID for each of the user's current & trading accounts
└ userIdintegerUnique ID for the user
└ typeintegerAccount type: 1 for current account, 2 for trading account
└ namestringAccount name
└ statusintegerAccount status: All active accounts have status 1
└ updateDateintegerDatetime (in UNIX time) last calculated
└ tokensobject[]List of tokens in account
└└ tokenIdintegerETHGas Token ID
└└ quantitystringAmount of token in account
└└ lockedQuantitystringAmount covering pending limit orders
└└ codestringToken code
└└ availableQuantitystringAvailable quantity

GET /v1/user/account/:accountId/txs

Get account transactions for a given account ID.

curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/account/128/txs"

Request

ParameterRequiredTypeDescription
accountIdYESintegerAccount ID
typeNOstringTransaction type (comma-separated for multiple types)
startIdNOintegerStart of transaction ID
limitNOintegerMax number of transactions to return

Response Body

NameTypeDescription
txsobject[]List of transaction objects
└ trxIdintegerUnique ID for the transaction
└ accountIdintegerAccount ID
└ tokenIdintegerETHGas Token ID
└ typeintegerTransaction type (see Transaction Types)
└ quantitystringTransaction quantity
└ balancestringBalance of account after transaction
└ createDateintegerTransaction datetime stamp (in UNIX time)

GET /v1/user/account/txs

Get account transactions for the current user.

curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/account/txs"

Request

ParameterRequiredTypeDescription
typeNOstringTransaction type (comma-separated for multiple types)
startIdNOintegerStart of transaction ID
limitNOintegerMax number of transactions to return (default: 20, max: 100)

Response Body

NameTypeDescription
txsobject[]List of transaction objects
└ trxIdintegerUnique ID for the transaction
└ accountIdintegerAccount ID
└ tokenIdintegerETHGas Token ID
└ typeintegerTransaction type
└ quantitystringTransaction quantity
└ balancestringBalance of account after transaction
└ createDateintegerTransaction datetime stamp (in UNIX time)

POST /v1/user/account/transfer/token

Transfer token between accounts.

curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/user/account/transfer/token?fromAccountId=128&toAccountId=127&tokenId=1&quantity=0.01"

Request

ParameterRequiredTypeDescription
fromAccountIdYESintegerSource account ID
toAccountIdYESintegerDestination account ID
tokenIdYESintegerToken ID
quantityYESnumberQuantity

Response Body

NameTypeDescription
dataobjectEmpty on success