This is an Express app designed to demo an implementation of how to interact with the Okto 3pBFF through API calls. It shows the implementation of three categories of APIs:
- Auth APIs (
authRoutes.ts
) - Explorer APIs (
explorerRoutes.ts
) - Intent APIs (
intentRoutes.ts
)
Each of these route files demonstrates how to interact with the Okto backend for their respective API categories.
Method | Path | Description |
---|---|---|
POST | /email/otp | Request OTP for email |
POST | /email/verify-otp | Verify OTP for email |
POST | /whatsapp/otp | Request OTP for WhatsApp |
POST | /whatsapp/verify-otp | Verify OTP for WhatsApp |
POST | /authenticate | Authenticate user |
Method | Path | Description |
---|---|---|
GET | /account | Get account details |
GET | /chains | Get supported chains |
GET | /tokens | Get supported tokens |
GET | /portfolio | Get portfolio summary |
GET | /portfolio-activity | Get portfolio activity |
GET | /portfolio-nft | Get portfolio NFTs |
GET | /order-history | Get order history |
POST | /read-contract-data | Read data from a smart contract |
Method | Path | Description |
---|---|---|
POST | /tokenTransfer | Initiate a token transfer intent |
POST | /rawTransaction | Initiate a raw transaction intent |
POST | /tokenTransfer/estimate | Estimate a token transfer intent |
POST | /rawTransaction/estimate | Estimate a raw transaction intent |
POST | /tokenTransfer/executeAfterEstimate | Execute token transfer after estimation |
POST | /rawTransaction/executeAfterEstimate | Execute raw transaction after estimation |
Follow these steps to run the app locally:
-
Clone the repository:
git clone https://github.com/okto-hq/okto-sdkv2-express-template-app.git cd okto-sdkv2-express-template-app
-
Install dependencies:
npm install
-
Set up environment variables:
- Copy the example environment file and update it with your values:
cp .env.example .env
- Open
.env
and fill in the required environment variables (such asPORT
,BASE_URL
,OKTO_ENVIRONMENT
, etc.).
- Copy the example environment file and update it with your values:
-
Run the app:
npm run dev
The server will start on port 3000 by default (or the port you specify in your
.env
).
A complete Postman collection is available for all endpoints in this app.
- Download or view here:
Okto-express-template-app.postman_collection.json