Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.nexfi.robert.dpdns.org/llms.txt

Use this file to discover all available pages before exploring further.

Bridge Routes and Orders

This page mirrors the detailed design style for Bridge user-side APIs, including endpoint purpose, request fields, response fields, examples, and business notes.

GET /api/v1/bridge/routes

Purpose

Queries available bridge routes before the user confirms a cross-chain transfer.

Query Parameters

ParameterTypeRequiredDescriptionExample
fromChainIdIntegerYesSource chain ID.1
toChainIdIntegerYesDestination chain ID.8453
fromTokenStringYesSource asset symbol or identifier.USDC
toTokenStringYesDestination asset symbol or identifier.USDC
amountStringYesBridge amount.1000
walletAddressStringNoWallet address used by some providers for quote context.0xabc...

Example Request

GET /api/v1/bridge/routes?fromChainId=1&toChainId=8453&fromToken=USDC&toToken=USDC&amount=1000&walletAddress=0xabc...

Response Fields

FieldTypeDescriptionExample
data.routesArrayAvailable route list.[]
data.routes[].routeIdStringPlatform route ID.route_base_usdc_01
data.routes[].providerKeyStringProvider identifier.across
data.routes[].bridgeNameStringBridge display name.Across
data.routes[].estimatedReceiveAmountStringEstimated destination amount after fees.998.42
data.routes[].bridgeFeeAmountStringBridge fee amount.1.10
data.routes[].networkFeeAmountStringNetwork fee amount.0.48
data.routes[].estimatedArrivalSecondsIntegerEstimated arrival time in seconds.420
data.routes[].riskLevelStringRoute risk level: low, medium, or high.medium

Example Response

{
  "code": 0,
  "msg": "ok",
  "data": {
    "routes": [
      {
        "routeId": "route_base_usdc_01",
        "providerKey": "across",
        "bridgeName": "Across",
        "estimatedReceiveAmount": "998.42",
        "bridgeFeeAmount": "1.10",
        "networkFeeAmount": "0.48",
        "estimatedArrivalSeconds": 420,
        "riskLevel": "medium"
      }
    ]
  }
}

Notes

  • Routes should be sorted by platform strategy rather than returned arbitrarily.
  • If no route is available, backend should return an empty array instead of a synthetic fallback.
  • Frontend should display bridge fee and network fee separately.

POST /api/v1/bridge/orders

Purpose

Creates a platform bridge order so the system can track the bridge lifecycle.

Request Body

ParameterTypeRequiredDescriptionExample
routeIdStringYesSelected route ID.route_base_usdc_01
fromChainIdIntegerYesSource chain ID.1
toChainIdIntegerYesDestination chain ID.8453
fromTokenStringYesSource asset.USDC
toTokenStringYesDestination asset.USDC
amountStringYesBridge amount.1000
senderAddressStringYesSource wallet address.0xabc...
recipientAddressStringYesDestination wallet address.0xabc...

Example Request

{
  "routeId": "route_base_usdc_01",
  "fromChainId": 1,
  "toChainId": 8453,
  "fromToken": "USDC",
  "toToken": "USDC",
  "amount": "1000",
  "senderAddress": "0xabc...",
  "recipientAddress": "0xabc..."
}

Response Fields

FieldTypeDescriptionExample
data.orderIdStringPlatform order ID.bridge_20260511_0001
data.statusStringInitial normalized order status.created
data.providerKeyStringBound provider.across

Example Response

{
  "code": 0,
  "msg": "ok",
  "data": {
    "orderId": "bridge_20260511_0001",
    "status": "created",
    "providerKey": "across"
  }
}

Notes

  • Creating an order means the backend starts tracking it; it does not mean bridging is already complete.
  • The user still signs and broadcasts the source-chain transaction locally.
  • The platform order should later be linked to provider order IDs and source-chain transaction hashes.

GET /api/v1/bridge/orders/{id}

Purpose

Returns normalized bridge order status by platform order ID.

Path Parameters

ParameterTypeRequiredDescriptionExample
idStringYesPlatform order ID.bridge_20260511_0001

Response Fields

FieldTypeDescriptionExample
data.orderIdStringPlatform order ID.bridge_20260511_0001
data.providerKeyStringProvider identifier.across
data.statusStringNormalized order status.bridging
data.sourceTxHashString | NullSource-chain transaction hash.0x123...
data.updatedAtStringLast update time.2026-05-11T10:00:00.000Z
data.failReasonString | NullFailure reason if any.null

Example Response

{
  "code": 0,
  "msg": "ok",
  "data": {
    "orderId": "bridge_20260511_0001",
    "providerKey": "across",
    "status": "bridging",
    "sourceTxHash": "0x123...",
    "updatedAt": "2026-05-11T10:00:00.000Z",
    "failReason": null
  }
}

Order Status Semantics

StatusMeaning
createdOrder is created and waiting for the user to submit the source transaction.
pending_sourceSource-side activity is detected but bridge execution is not fully underway yet.
bridgingProvider is actively executing the bridge.
completedDestination-side settlement is complete.
failedBridge execution failed.
cancelledOrder was cancelled or expired.

Notes

  • Frontend should use the normalized platform status instead of raw provider states.
  • sourceTxHash may be empty before the user broadcasts the source-chain transaction.
  • Failure views should display both failReason and suggested next steps when available.