User
POST /v1/user/update
Update user display name.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/user/update?displayName=NewDisplayName"
import requests
url = f"{ETHGAS_API_URL}/v1/user/update"
payload = {'displayName': 'NewDisplayName'}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-auth-token>'
}
response = requests.post(url, headers=headers, params=payload)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| displayName | YES | string | Display name |
Response Body
| Name | Type | Description |
|---|---|---|
| user | object | Updated user object |
| └ userId | long | Unique user ID |
| └ address | string | User's wallet address |
| └ status | integer | User status (1 = active) |
| └ userType | integer | User type |
| └ userClass | integer | User class |
| └ displayName | string | User's display name |
| └ payoutAddress | string | User's payout address |
| └ collateralPerSlot | string | Collateral per slot amount |
| └ onchainPayout | boolean | Whether on-chain payout is enabled |
| └ accounts | object[] | List of user accounts |
| └└ accountId | long | Unique account ID |
| └└ userId | long | User ID associated with the account |
| └└ type | integer | Account type |
| └└ name | string | Account name |
| └└ status | integer | Account status |
| └└ updateDate | long | Last update timestamp in milliseconds |
POST /v1/user/payoutAddress
Update user payout address.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/user/payoutAddress?payoutAddress=0x1234567890123456789012345678901234567890"
import requests
url = f"{ETHGAS_API_URL}/v1/user/payoutAddress"
payload = {'payoutAddress': '0x1234567890123456789012345678901234567890'}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-auth-token>'
}
response = requests.post(url, headers=headers, params=payload)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| payoutAddress | YES | string | New payout address (hex format) |
Response Body
| Name | Type | Description |
|---|---|---|
| success | boolean | Operation success status |
POST /v1/user/collateralPerSlot
Update user collateral per slot amount.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X POST "$ETHGAS_API_URL/v1/user/collateralPerSlot?collateralPerSlot=10.5"
import requests
url = f"{ETHGAS_API_URL}/v1/user/collateralPerSlot"
payload = {'collateralPerSlot': '10.5'}
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-auth-token>'
}
response = requests.post(url, headers=headers, params=payload)
print(response.text)
Request
| Parameter | Required | Type | Description |
|---|---|---|---|
| collateralPerSlot | YES | BigDecimal | Collateral per slot amount (must be >= 0 and <= 100) |
Response Body
| Name | Type | Description |
|---|---|---|
| success | boolean | Operation success status |
Error Codes
collateralPerSlot must be within 0 to 100 (inclusive). Values < 0 trigger COLLATERAL_PER_SLOT_NEGATIVE, and values > 100 trigger COLLATERAL_PER_SLOT_TOO_LARGE.
| Code | Description |
|---|---|
| COLLATERAL_PER_SLOT_NEGATIVE | Collateral per slot cannot be negative |
| COLLATERAL_PER_SLOT_TOO_LARGE | Collateral per slot cannot exceed 100 |
GET /v1/user/info
Get user information.
- HTTP
- Python
curl -H "Authorization: Bearer {{access_token}}" -X GET "$ETHGAS_API_URL/v1/user/info"
import requests
url = f"{ETHGAS_API_URL}/v1/user/info"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer <your-auth-token>'
}
response = requests.get(url, headers=headers)
print(response.text)
Request
No parameters required.
Response Body
| Name | Type | Description |
|---|---|---|
| user | object | User object |
| └ userId | long | Unique user ID |
| └ address | string | User's wallet address |
| └ status | integer | User status (1 = active) |
| └ userType | integer | User type |
| └ userClass | integer | User class |
| └ displayName | string | User's display name |
| └ payoutAddress | string | User's payout address |
| └ collateralPerSlot | string | Collateral per slot amount |
| └ onchainPayout | boolean | Whether on-chain payout is enabled |
| └ accounts | object[] | List of user accounts |
| └└ accountId | long | Unique account ID |
| └└ userId | long | User ID associated with the account |
| └└ type | integer | Account type |
| └└ name | string | Account name |
| └└ status | integer | Account status |
| └└ updateDate | long | Last update timestamp in milliseconds |