Skip to main content

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": []
}
FieldTypeDescriptionRequiredDefault
jsonrpcstringThe JSON-RPC versionYes"2.0"
chainIDnumberThe JSON-RPC chainIDYes2484
apiKeystringDeveloper API keyYes-
idanyRequest identifierNo0
methodstringMethod to be invokedYes-
paramsarrayParameters for the methodNo[]

Web3SignDto

Used for Web3 wallet signature authentication.

{
"signature": "0x25cf4f771bc466e31f7a9cdfebfb11741788b481388d622b1e5dfa2a479e72972d328a364ca45eaa432665bbbc6c08e1eee8c40007eb4244f0894199b71542b61c",
"signer": "0x556180984Ec8B4d28476376f99A071042f262a5c"
}
FieldTypeDescriptionRequired
signaturestringThe signature of the userYes
signerstringThe un-capitalized addressYes

LoginResponseDto

Response returned after successful authentication.

{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshTokenExpire": 1710175253716,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"accessTokenExpire": 1710175253716,
"userId": "0x2743eec46576f76f47334569074242f3d9a90b44"
}
FieldTypeDescriptionRequired
refreshTokenstringJWT refresh tokenYes
refreshTokenExpirenumberRefresh token expiration timestampYes
accessTokenstringJWT access tokenYes
accessTokenExpirenumberAccess token expiration timestampYes
userIdstringThe user's ID/addressYes

RefreshTokenDto

Used to request a new access token.

{
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOnsidXNlcklkIjozLCJhcGlLZXkiOiJzeXMtZGV2LWFwaS1rZXkifSwiaWF0IjoxNzM4NzQ0NjkxLCJleHAiOjE3MzkzNDk0OTF9.r0szPoXLxNkCxyJoCHD-lcGlbrDNnZmWtRsGBjLaeuo"
}
FieldTypeDescriptionRequired
refreshTokenstringThe refresh token of the userYes

Telegram Authentication Models

TelegramRequestOTPDTO

Used to request an OTP for Telegram authentication.

{
"telegramId": "637528594"
}
FieldTypeDescriptionRequired
telegramIdstringUnique Telegram ID of the userYes

TelegramLoginDTO

Used for Telegram login with OTP.

{
"telegramId": "637528594",
"username": "dangnp",
"firstname": "DANG",
"lastname": "NGUYEN",
"avatarUrl": "https://example.com/avatar.jpg",
"otp": "123456"
}
FieldTypeDescriptionRequired
telegramIdstringUnique Telegram ID of the userYes
usernamestringTelegram usernameNo
firstnamestringFirst name of the Telegram userNo
lastnamestringLast name of the Telegram userNo
avatarUrlstringAvatar URL of the Telegram userNo
otpstringOTP code for authenticationYes

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"
}
FieldTypeDescriptionRequired
telegramIdstringUnique Telegram ID of the userYes
usernamestringTelegram usernameNo
firstnamestringFirst name of the Telegram userNo
lastnamestringLast name of the Telegram userNo
domainIdnumberDomain ID that user is trying to log inNo
sigstringSignature to verify the data from the login botYes
timestampnumberTimestamp when the bot signed the dataYes
apiKeystringAPI Key from the app for loginYes

TelegramBotLoginGetSessionDTO

Used for getting a login session from Telegram bot.

{
"state": "637528594",
"code": "4Q49OK0KD93GW7H9"
}
FieldTypeDescriptionRequired
statestringState of login actionYes
codestringSession code to authorize the requestYes

Email Authentication Models

EmailRequestOTPDTO

Used to request an OTP via email.

{
"email": "[email protected]"
}
FieldTypeDescriptionRequired
emailstringUnique email of the userYes

EmailOTPVerifyDTO

Used to verify an email OTP for login.

{
"email": "[email protected]",
"otp": "123456"
}
FieldTypeDescriptionRequired
emailstringEmail address of the userYes
otpstringOTP code for authenticationYes

OAuth Models

OauthCallbackDto

Used for OAuth provider callbacks.

{
"code": "F0ASVgi3LIHziCA6lkUipWhD-9j1HZTMLR5y1ExzhpzS9aZueaw6eZkFBva4gCvACrCV1VRw",
"error": "mismatch_redirect_uri",
"state": "eyJrZXkiOiI3YzU4MTYwOTI5M0U1MDNkRTE0OWQ5M2YzNDc2N0RGRjMzZDMyQzE2IiwieC1zaWduYXR1cmUiOiIweGY0MWZjY2FlN2EwNjI3OGExOTVkM2NhMzkzMTE0Y2I5NmM4ZGViMGUxM2QwN2E3OWI2MjFlMWE5YWQzYmJmZjAwMjkzMGUwNTZkM2EwMWNmZDlkMGJiNjc3MWNkOTQ2M2Q5NjI2ODc4ODYzMzVkZjE5N2ExZWE4ZDQ4NGY4OWViMWMiLCJ4LXRpbWVzdGFtcCI6IjE3NDA1NTgxMTAxMzMiLCJ4LWFwaS1rZXkiOiI3YzU4MTYwOTI5M0U1MDNkRTE0OWQ5M2YzNDc2N0RGRjMzZDMyQzE2Iiwib3JpZ2luIjoiaHR0cDovL2xvY2FsaG9zdDozMDAwIn0"
}
FieldTypeDescriptionRequired
codestringThe code from the social providerYes
errorstringError from the social providerYes
statestringState from the social providerYes

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"
}
FieldTypeDescriptionRequiredMax Length
usernamestringUsername for the userNo50
firstnamestringUser's first nameNo50
lastnamestringUser's last nameNo50
avatarstringURL to user's avatar imageNo-
signaturestringUser signature or bioNo200

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
}
FieldTypeDescriptionRequiredMax Length
telegramIdstringTelegram user IDYes-
telegramUsernamestringTelegram usernameNo50
telegramFirstNamestringFirst name from Telegram profileNo50
telegramLastNamestringLast name from Telegram profileNo50
telegramAvatarUrlstringURL to Telegram profile pictureNo-
telegramAuthDatedate-timeDate when Telegram auth occurredNo-
telegramVerifiedbooleanWhether Telegram account is verifiedNo-

Blockchain Models

SendTransactionDTO

Used to send blockchain transactions.

{
"chainId": 2484,
"sponsor": true,
"transactionReq": {
"to": "0xB246603EF552D8372c4c91c5BAEf2Eed9c902fF4",
"value": "1000000000000000",
"data": "0x",
"maxPriorityFeePerGas": "1800000000"
},
"appApiKey": "B246603EF552D8372c4c91c5BAEf2Eed9c902fF4"
}
FieldTypeDescriptionRequired
chainIdnumberThe blockchain chain IDYes
sponsorbooleanWhether to use gas sponsorshipYes
transactionReqobjectTransaction details objectYes
appApiKeystringAPI key for the app to send transaction toNo

Transaction Request Object

FieldTypeDescription
tostringRecipient address
valuestringAmount to send (in wei)
datastringTransaction data (for contract interactions)
maxPriorityFeePerGasstringMaximum priority fee per gas