🤖API Documentation
This document provides an overview and explanation of the available endpoints for bridging currencies between networks. Each endpoint includes details on request parameters, responses and examples.
Base URL
http://34.30.82.237:3000/
Summary
GET
/currencies
- Lists available currencies and networksPOST
/simulate
- Provides an estimation (amount out, fees, time) for a bridging requestPOST
/bridge
- Initiates a bridging order and provides deposit detailsPOST
/status
- Retrieves and returns the current status of a specific bridge order
Endpoints
GET /currencies
Fetches all the currencies that are available for bridging
Method: GET
URL: http://34.30.82.237:3000/currencies
Parameters: None
Response: {
status: 200 | 500
data: [
{
network: string
ticker: string
}
] | string
}
Example Response:
{
status: 200,
data: [
{
network: "ton",
ticker: "ton"
},
{
network: "eth",
ticker: "eth"
}
]
}
or
{
status: 500,
data: string (error message)
}
POST /simulate
Calculates the estimated output amount, fees, and other details for a given bridge
Method: POST
URL: http://34.30.82.237:3000/simulate
Parameters: {
fromCurrency: string
fromNetwork: string
amount: number
toCurrency: string
toNetwork: string
}
Response: {
status: 200 | 500
data: {
toAmount: number
fee: string
fromCurrency: string
fromNetwork: string
toCurrency: string
toNetwork: string
minInput: number
maxInput: number (-1 if max is unlimited)
fromAmount: number
estimatedTime: string
warningMessage: string | null
} | string
}
Example Response:
{
status: 200,
data: {
toAmount: 344.93,
fee: "0.15",
fromCurrency: "sol",
fromNetwork: "sol",
toCurrency: "ton",
toNetwork: "ton",
minInput: 0.003,
maxInput: -1,
fromAmount: 10,
estimatedTime: "10-60",
warningMessage: null
}
}
or
{
status: 500,
data: string (error message)
}
POST /bridge
Creates a bridge order. Returns deposit details and order status so that the user can initiate the transfer
Method: POST
URL: http://34.30.82.237:3000/bridge
Parameters: {
fromCurrency: string
fromNetwork: string
amount: number
toCurrency: string
toNetwork: string
recipientAddress: string
ref: string | null
}
Response: {
status: 200 | 500
data: {
fromAmount: number
toAmount: number
fromCurrency: string
fromNetwork: string
toCurrency: string
toNetwork: string
recipientAddress: string
depositAddress: string
status: "pending" | "bridging" | "sending" | "completed"
step: 0 | 1 | 2 | 3
createdAt: number (milliseconds since epoch time)
updatedAt: number (milliseconds since epoch time)
payinExtraId: string | null (Additional ID required by some currencies (e.g. XRP destination tag))
payinExtraIdName: string | null
ref: string | null
id: string
} | string
}
Example Response:
{
status: 200,
data: {
fromAmount: 10,
toAmount: 344.93,
fromCurrency: "sol",
fromNetwork: "sol",
toCurrency: "ton",
toNetwork: "ton",
recipientAddress: "UQBWUSFOsIK_CEIP9C48DbSqtgxhLw7i0S_C2ua93nsY0N3d",
depositAddress: "B8GAmjDfibcJzaKafQdpfskpsH2rPamSH2H2Xk563eLf",
status: "pending",
step: 0,
createdAt: 1734108936293,
updatedAt: 1734108936293,
payinExtraId: null,
payinExtraIdName: null,
ref: null,
id: ei29rah98feu
}
}
or
{
status: 500,
data: string (error message)
}
POST /status
Retrieves the current status of a previously created bridge order
Method: POST
URL: http://34.30.82.237:3000/status
Parameters: {
orderId: string
}
Response: {
status: 200 | 500
data: {
fromAmount: number
toAmount: number
fromCurrency: string
fromNetwork: string
toCurrency: string
toNetwork: string
recipientAddress: string
depositAddress: string
status: "pending" | "bridging" | "sending" | "completed"
step: 0 | 1 | 2 | 3
createdAt: number (milliseconds since epoch time)
updatedAt: number (milliseconds since epoch time)
payinExtraId: string | null (Additional ID required by some currencies (e.g. XRP destination tag))
payinExtraIdName: string | null
ref: string | null
id: string
} | string
}
Example Response:
{
status: 200,
data: {
fromAmount: 10,
toAmount: 344.93,
fromCurrency: "sol",
fromNetwork: "sol",
toCurrency: "ton",
toNetwork: "ton",
recipientAddress: "UQBWUSFOsIK_CEIP9C48DbSqtgxhLw7i0S_C2ua93nsY0N3d",
depositAddress: "B8GAmjDfibcJzaKafQdpfskpsH2rPamSH2H2Xk563eLf",
status: "sending",
step: 2,
createdAt: 1734108936293,
updatedAt: 1734109145245,
payinExtraId: null,
payinExtraIdName: null,
ref: null,
id: ei29rah98feu
}
}
or
{
status: 500,
data: string (error message)
}
Last updated