Data Models
This page documents the data models and schemas used in the Universal Account API.
Authentication Models
JsonRPCRequestDto
Used for JSON-RPC requests to the bundler service.
{
"jsonrpc": "2.0",
"chainID": 2484,
"apiKey": "7c581609293E503dE149d93f34767DFF33d32C16",
"id": 0,
"method": "eth_supportedEntryPoints",
"params": []
}
Field | Type | Description | Required | Default |
---|---|---|---|---|
jsonrpc | string | The JSON-RPC version | Yes | "2.0" |
chainID | number | The JSON-RPC chainID | Yes | 2484 |
apiKey | string | Developer API key | Yes | - |
id | any | Request identifier | No | 0 |
method | string | Method to be invoked | Yes | - |
params | array | Parameters for the method | No | [] |
Web3SignDto
Used for Web3 wallet signature authentication.
{
"signature": "0x25cf4f771bc466e31f7a9cdfebfb11741788b481388d622b1e5dfa2a479e72972d328a364ca45eaa432665bbbc6c08e1eee8c40007eb4244f0894199b71542b61c",
"signer": "0x556180984Ec8B4d28476376f99A071042f262a5c"
}
Field | Type | Description | Required |
---|---|---|---|
signature | string | The signature of the user | Yes |
signer | string | The un-capitalized address | Yes |
LoginResponseDto
Response returned after successful authentication.
{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshTokenExpire": 1710175253716,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"accessTokenExpire": 1710175253716,
"userId": "0x2743eec46576f76f47334569074242f3d9a90b44"
}
Field | Type | Description | Required |
---|---|---|---|
refreshToken | string | JWT refresh token | Yes |
refreshTokenExpire | number | Refresh token expiration timestamp | Yes |
accessToken | string | JWT access token | Yes |
accessTokenExpire | number | Access token expiration timestamp | Yes |
userId | string | The user's ID/address | Yes |
RefreshTokenDto
Used to request a new access token.
{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsidXNlcklkIjozLCJhcGlLZXkiOiJzeXMtZGV2LWFwaS1rZXkifSwiaWF0IjoxNzM4NzQ0NjkxLCJleHAiOjE3MzkzNDk0OTF9.r0szPoXLxNkCxyJoCHD-lcGlbrDNnZmWtRsGBjLaeuo"
}
Field | Type | Description | Required |
---|---|---|---|
refreshToken | string | The refresh token of the user | Yes |
Telegram Authentication Models
TelegramRequestOTPDTO
Used to request an OTP for Telegram authentication.
{
"telegramId": "637528594"
}
Field | Type | Description | Required |
---|---|---|---|
telegramId | string | Unique Telegram ID of the user | Yes |
TelegramLoginDTO
Used for Telegram login with OTP.
{
"telegramId": "637528594",
"username": "dangnp",
"firstname": "DANG",
"lastname": "NGUYEN",
"avatarUrl": "https://example.com/avatar.jpg",
"otp": "123456"
}
Field | Type | Description | Required |
---|---|---|---|
telegramId | string | Unique Telegram ID of the user | Yes |
username | string | Telegram username | No |
firstname | string | First name of the Telegram user | No |
lastname | string | Last name of the Telegram user | No |
avatarUrl | string | Avatar URL of the Telegram user | No |
otp | string | OTP code for authentication | Yes |
TelegramBotLoginDTO
Used to create a new user from Telegram bot login.
{
"telegramId": "637528594",
"username": "dangnp",
"firstname": "DANG",
"lastname": "NGUYEN",
"domainId": 1,
"sig": "0xe8fb8b8a653f7a85068a58d3346f8c26a805b1047367c3275215a896891d94fe79b24719653bfd2b7a0835d7c8dd8279e022e17370250e02800a2cc7f973f84b1b",
"timestamp": 1741084672,
"apiKey": "7c581609293E503dE149d93f34767DFF33d32C16"
}
Field | Type | Description | Required |
---|---|---|---|
telegramId | string | Unique Telegram ID of the user | Yes |
username | string | Telegram username | No |
firstname | string | First name of the Telegram user | No |
lastname | string | Last name of the Telegram user | No |
domainId | number | Domain ID that user is trying to log in | No |
sig | string | Signature to verify the data from the login bot | Yes |
timestamp | number | Timestamp when the bot signed the data | Yes |
apiKey | string | API Key from the app for login | Yes |
TelegramBotLoginGetSessionDTO
Used for getting a login session from Telegram bot.
{
"state": "637528594",
"code": "4Q49OK0KD93GW7H9"
}
Field | Type | Description | Required |
---|---|---|---|
state | string | State of login action | Yes |
code | string | Session code to authorize the request | Yes |
Email Authentication Models
EmailRequestOTPDTO
Used to request an OTP via email.
{
"email": "[email protected]"
}
Field | Type | Description | Required |
---|---|---|---|
email | string | Unique email of the user | Yes |
EmailOTPVerifyDTO
Used to verify an email OTP for login.
{
"email": "[email protected]",
"otp": "123456"
}
Field | Type | Description | Required |
---|---|---|---|
email | string | Email address of the user | Yes |
otp | string | OTP code for authentication | Yes |
OAuth Models
OauthCallbackDto
Used for OAuth provider callbacks.
{
"code": "F0ASVgi3LIHziCA6lkUipWhD-9j1HZTMLR5y1ExzhpzS9aZueaw6eZkFBva4gCvACrCV1VRw",
"error": "mismatch_redirect_uri",
"state": "eyJrZXkiOiI3YzU4MTYwOTI5M0U1MDNkRTE0OWQ5M2YzNDc2N0RGRjMzZDMyQzE2IiwieC1zaWduYXR1cmUiOiIweGY0MWZjY2FlN2EwNjI3OGExOTVkM2NhMzkzMTE0Y2I5NmM4ZGViMGUxM2QwN2E3OWI2MjFlMWE5YWQzYmJmZjAwMjkzMGUwNTZkM2EwMWNmZDlkMGJiNjc3MWNkOTQ2M2Q5NjI2ODc4ODYzMzVkZjE5N2ExZWE4ZDQ4NGY4OWViMWMiLCJ4LXRpbWVzdGFtcCI6IjE3NDA1NTgxMTAxMzMiLCJ4LWFwaS1rZXkiOiI3YzU4MTYwOTI5M0U1MDNkRTE0OWQ5M2YzNDc2N0RGRjMzZDMyQzE2Iiwib3JpZ2luIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwIn0"
}
Field | Type | Description | Required |
---|---|---|---|
code | string | The code from the social provider | Yes |
error | string | Error from the social provider | Yes |
state | string | State from the social provider | Yes |
User Profile Models
UpdateProfileDto
Used to update a user's profile information.
{
"username": "john_doe",
"firstname": "John",
"lastname": "Doe",
"avatar": "https://example.com/avatar.jpg",
"signature": "Crypto enthusiast"
}
Field | Type | Description | Required | Max Length |
---|---|---|---|---|
username | string | Username for the user | No | 50 |
firstname | string | User's first name | No | 50 |
lastname | string | User's last name | No | 50 |
avatar | string | URL to user's avatar image | No | - |
signature | string | User signature or bio | No | 200 |
UpdateTelegramDto
Used to update a user's Telegram information.
{
"telegramId": "123456789",
"telegramUsername": "@johndoe",
"telegramFirstName": "John",
"telegramLastName": "Doe",
"telegramAvatarUrl": "https://t.me/i/userpic/123.jpg",
"telegramAuthDate": "2024-01-25T12:00:00Z",
"telegramVerified": true
}
Field | Type | Description | Required | Max Length |
---|---|---|---|---|
telegramId | string | Telegram user ID | Yes | - |
telegramUsername | string | Telegram username | No | 50 |
telegramFirstName | string | First name from Telegram profile | No | 50 |
telegramLastName | string | Last name from Telegram profile | No | 50 |
telegramAvatarUrl | string | URL to Telegram profile picture | No | - |
telegramAuthDate | date-time | Date when Telegram auth occurred | No | - |
telegramVerified | boolean | Whether Telegram account is verified | No | - |
Blockchain Models
SendTransactionDTO
Used to send blockchain transactions.
{
"chainId": 2484,
"sponsor": true,
"transactionReq": {
"to": "0xB246603EF552D8372c4c91c5BAEf2Eed9c902fF4",
"value": "1000000000000000",
"data": "0x",
"maxPriorityFeePerGas": "1800000000"
},
"appApiKey": "B246603EF552D8372c4c91c5BAEf2Eed9c902fF4"
}
Field | Type | Description | Required |
---|---|---|---|
chainId | number | The blockchain chain ID | Yes |
sponsor | boolean | Whether to use gas sponsorship | Yes |
transactionReq | object | Transaction details object | Yes |
appApiKey | string | API key for the app to send transaction to | No |
Transaction Request Object
Field | Type | Description |
---|---|---|
to | string | Recipient address |
value | string | Amount to send (in wei) |
data | string | Transaction data (for contract interactions) |
maxPriorityFeePerGas | string | Maximum priority fee per gas |