API Endpoints
The backend server makes available the necessary endpoints for communication with any client application. Additionally, it exposes a webhook endpoint where Fireblocks can send asynchronous operation messages.
Authentication
Routes:
POST /api/login
- is exposed for users login
Controller:
User controller is defined in:/src/controllers/user.controller.ts/UserController
Device
Routes:
GET /api/devices
- used for returning all the devices registered in the DBPOST /api/devices/:deviceId/assign
- used for assigning a newly generated deviceId to awalletId
anduserId
GET /api/devices/:deviceId
- get a specificdeviceId
information
The following endpoint is used for sending NCW SDK generated messages to the backend that will forward these to Fireblocks API
GET /api/devices/:deviceId/rpc
Controller:
The device controller is defined in: /src/controllers/device.controller.ts/DeviceController
Messages
GET /api/devices/:deviceId/messages
- get messages for a specificdeviceId
DELETE /api/devices/messages/:messageId
- delete a consumed message by it's unique ID
Controller:
Messages controller is defined in: /src/controllers/message.controller.ts/MessageController
Accounts
Routes:
GET /api/devices/:deviceId/accounts
- get all the accounts for a specificdeviceId
Controller:
Account controller is defined in: /src/controllers/account.controller.ts/AccountController
Assets
Routes:
GET /api/devices/:deviceId/accounts/:accountId/assets
- Get all the existing assets for a specific accountGET /api/devices/:deviceId/accounts/:accountId/assets/:assetId
- Get a specific asset in a specific accountGET /api/devices/:deviceId/accounts/:accountId/assets/:assetId/balance
- Get asset balance in a specific accountGET /api/devices/:deviceId/accounts/:accountId/assets/:assetId/address
- Get the address of a specific asset in a specific accountPOST /api/devices/:deviceId/accounts/:accountId/assets/:assetId
- Create a new asset in a specific account
Controller:
Asset controller is defined in: /src/controllers/asset.controller.ts/AssetController
Transactions
Routes:
GET /api/devices/:deviceId/transactions
- get all transactions for a specificdeviceId
POST /api/devices/:deviceId/transactions
- create new transaction. Currently the transaction data is hard coded in the transaction controller, but can be easily modified according to your needsGET /api/devices/:deviceId/transactions/:transactionId
- get a specific transaction by it's unique IDPOST /api/devices/:deviceId/transactions/:txId/cancel
- cancel a specific transaction by it's unique ID
Controller:
Transaction controller is defined in: /src/controllers/transaction.controller.ts/TransactionController
Updated about 1 year ago