gRPC API
UserService
RegisterUser
- Type: Unary RPC
- Request:
RegisterUserRequest
- Response:
RegisterUserResponse
Creates a new user, either by generating a new UUID or by using a UUID specified in the request.
Request Message: RegisterUserRequest
Field | Type | Required | Description |
---|---|---|---|
userId | string | No | The unique UUID of the user. |
Response Message: RegisterUserResponse
Field | Type | Description |
---|---|---|
userId | string | The unique UUID of the user. |
Errors:
Error Code | Message | Description |
---|---|---|
InvalidArgument | Invalid userId (invalid UUID). | Provided in the request userId is not a UUID. |
InvalidArgument | Invalid userId (user exists). | Provided in the request userId already exists in DB. |
Internal | An error occurred while initiating an SQL transaction. | None. |
Internal | An error occurred while executing a SQL query. | None. |
UpdateCryptoKeys
- Type: Unary RPC
- Request:
UpdateCryptoKeysRequest
- Response:
UpdateCryptoKeysResponse
Updates the user`s crypto keys.
Request Message: UpdateCryptoKeysRequest
Field | Type | Required | Description |
---|---|---|---|
userId | string | Yes | The unique UUID of the user. |
xmrReq | XmrKeysUpdateRequest | No | XMR crypto keys update request. |
btcReq | BtcKeysUpdateRequest | No | BTC crypto keys update request. |
ltcReq | LtcKeysUpdateRequest | No | LTC crypto keys update request. |
ethReq | EthKeysUpdateRequest | No | ETH crypto keys update request. |
bnbReq | BnbKeysUpdateRequest | No | BNB crypto keys update request. |
Response Message: UpdateCryptoKeysResponse
None.
Errors:
Error Code | Message | Description |
---|---|---|
InvalidArgument | Invalid userId (invalid UUID). | Provided in the request userId is not a UUID. |
InvalidArgument | Invalid userId (user does not exist). | The user with the provided userId in the request does not exist. |
Internal | An error occurred while initiating an SQL transaction. | None. |
Internal | An error occurred while executing a SQL query. | None. |
InvoiceService
CreateInvoice
- Type: Unary RPC
- Request:
CreateInvoiceRequest
- Response:
CreateInvoiceResponse
Creates a new invoice.
Request Message: CreateInvoiceRequest
Field | Type | Required | Description |
---|---|---|---|
userId | string | Yes | The unique UUID of the user. |
coin | CoinType | Yes | The type of cryptocurrency for which the invoice is generated. |
amount | double | Yes | The amount of cryptocurrency should be invoiced. |
timeout | uint64 | Yes | The maximum duration (in seconds) that the system should wait for an invoice to be paid before timing out. |
confirmations | uint32 | Yes | The number of confirmations required for the transaction to validate the invoice. |
Response Message: CreateInvoiceResponse
Field | Type | Description |
---|---|---|
paymentId | string | The unique UUID of the invoice. |
address | string | The cryptocurrency address that was assigned to the invoice. |
Errors:
Error Code | Message | Description |
---|---|---|
InvalidArgument | Invoice amount can't be below 0. | None. |
InvalidArgument | Invalid userId (user does not exist). | The user with the provided userId in the request does not exist. |
Internal | An error occurred while handling invoice. | None. |
InvoiceStatusStream
- Type: Stream RPC
- Request:
InvoiceStatusStreamRequest
- Response:
InvoiceStatusStreamResponse
The stream RPC provides real-time updates on the status of invoices.
Request Message: InvoiceStatusStreamRequest
None.
Response Stream Message: InvoiceStatusStreamResponse
Field | Type | Description |
---|---|---|
invoice | Invoice | None. |
Errors:
Error Code | Message | Description |
---|---|---|
Canceled | Stream has been closed. | None. |
Canceled | An error occured while sending data. | None. |
Misc types/enums
Invoice
Field | Type | Description |
---|---|---|
id | string | None. |
cryptoAddress | string | None. |
coin | CoinType | None. |
requiredAmount | double | None. |
actualAmount | double | None. |
confirmationsRequired | uint32 | None. |
createdAt | google.protobuf.Timestamp | None. |
confirmedAt | google.protobuf.Timestamp | None. |
status | InvoiceStatusType | None. |
expiresAt | google.protobuf.Timestamp | None. |
txId | string | None. |
userId | string | None. |
InvoiceStatusType
Type | Description |
---|---|
PENDING | None. |
PENDING_MEMPOOL | None. |
EXPIRED | None. |
CONFIRMED | None. |
CoinType
Type | Description |
---|---|
XMR | None. |
BTC | None. |
LTC | None. |
ETH | None. |
TON | None. |
USDT_ERC20 | ERC-20 token. |
USDC_ERC20 | ERC-20 token. |
DAI_ERC20 | ERC-20 token. |
WBTC_ERC20 | ERC-20 token. |
UNI_ERC20 | ERC-20 token. |
LINK_ERC20 | ERC-20 token. |
AAVE_ERC20 | ERC-20 token. |
CRV_ERC20 | ERC-20 token. |
MATIC_ERC20 | ERC-20 token. |
SHIB_ERC20 | ERC-20 token. |
BNB_ERC20 | ERC-20 token. |
ATOM_ERC20 | ERC-20 token. |
ARB_ERC20 | ERC-20 token. |
BNB | None. |
BSCUSD_BEP20 | BEP-20 token |
USDC_BEP20 | BEP-20 token |
DAI_BEP20 | BEP-20 token |
BUSD_BEP20 | BEP-20 token |
WBTC_BEP20 | BEP-20 token |
BTCB_BEP20 | BEP-20 token |
UNI_BEP20 | BEP-20 token |
LINK_BEP20 | BEP-20 token |
AAVE_BEP20 | BEP-20 token |
MATIC_BEP20 | BEP-20 token |
SHIB_BEP20 | BEP-20 token |
ATOM_BEP20 | BEP-20 token |
ARB_BEP20 | BEP-20 token |
ETH_BEP20 | BEP-20 token |
XRP_BEP20 | BEP-20 token |
ADA_BEP20 | BEP-20 token |
TRX_BEP20 | BEP-20 token |
DOGE_BEP20 | BEP-20 token |
LTC_BEP20 | BEP-20 token |
BCH_BEP20 | BEP-20 token |
TWT_BEP20 | BEP-20 token |
AVAX_BEP20 | BEP-20 token |
CAKE_BEP20 | BEP-20 token |
XmrKeysUpdateRequest
Field | Type | Description |
---|---|---|
privViewKey | string | None. |
pubSpendKey | string | None. |
BtcKeysUpdateRequest
Field | Type | Description |
---|---|---|
masterPubKey | string | None. |
LtcKeysUpdateRequest
Field | Type | Description |
---|---|---|
masterPubKey | string | None. |
EthKeysUpdateRequest
Field | Type | Description |
---|---|---|
masterPubKey | string | None. |
BnbKeysUpdateRequest
Field | Type | Description |
---|---|---|
masterPubKey | string | None. |