Order Tracking
getOrderIdByTransactionHash
Retrieve the order ID associated with a transaction hash.Transaction hash from the source chain
Returns order IDs associated with the transaction
src/utils/deBridge/index.ts:1
Example:
getOrderStatusByOrderId
Retrieve the current status and details of a bridge order.Unique order identifier
Returns complete order status including source and destination transaction details
src/utils/deBridge/index.ts:22
Example:
Order Creation
createDebridgeBridgeOrder
Create a bridge order for cross-chain token transfer.Bridge order parameters object
Source chain ID
Token address on source chain
Amount to bridge in token’s smallest unit
Destination chain ID (must differ from source)
Token address on destination chain
Recipient address on destination chain
Sender’s wallet address
Expected output amount (default: “auto”)
Referral code for the transaction
Affiliate fee percentage (must be used with affiliateFeeRecipient)
Address to receive affiliate fees
Returns bridge order details including transaction data
src/utils/deBridge/createDeBridgeOrder.ts:17
Example:
createDebridgeBridgeHook
Create a bridge order with a hook for executing actions on the destination chain.Bridge order parameters with hookAll other parameters are the same as
Hook object containing destination chain actions
createDebridgeBridgeOrdersrc/utils/deBridge/createDeBridgeHook.ts:18
Example:
createDeBridgeSameChainSwap
Create a same-chain token swap transaction.Same-chain swap parameters
Chain ID where the swap occurs
Input token address
Amount to swap in token’s smallest unit
Output token address
Recipient address
Sender’s wallet address
Priority level: “normal” or “high” (default: “normal”)
Slippage tolerance (default: “auto”)
Referral code for tracking
Affiliate fee percentage (0-100)
src/utils/deBridge/sameChainSwap.ts:4
Example:
createDeBridgeSameChainSwapEstimate
Get an estimation for a same-chain token swap without creating a transaction.Estimation parameters
Chain ID where the swap will occur
Input token address
Amount to swap in token’s smallest unit
Output token address
Slippage tolerance (default: “auto”)
Affiliate fee percentage for calculation
src/utils/deBridge/sameChainSwapEstimate.ts:4
Example:
HTTP Utilities
post
Make a POST request to the deBridge API.API endpoint URL
Request body to send
src/utils/http.ts:1
get
Make a GET request to the deBridge API.API endpoint URL
src/utils/http.ts:26
Solana Utilities
prepareSolanaTransaction
Prepare a Solana transaction with appropriate priority fees and blockhash.RPC URL of the Solana network
Serialized transaction data from the API
Signer keypair
A signed Solana transaction ready for submission
src/utils/solana.ts:12
Features:
- Simulates the transaction to calculate compute units
- Fetches recent prioritization fees and sets a median priority fee
- Updates blockhash and signs the transaction
updatePriorityFee
Update the priority fee in a Solana transaction.Transaction to update
Compute unit price in micro-lamports
Optional compute unit limit
src/utils/index.ts:136
TRON Utilities
initTronWeb
Initialize a TronWeb client instance.src/utils/tron.ts:28
toTronHex41
Convert an address to TRON hex41 format.TronWeb instance
Address to convert (base58 or hex)
src/utils/tron.ts:20
simulateTriggerContract
Simulate a TRON smart contract call.src/utils/tron.ts:52
getTRC20Balance
Get TRC20 token balance.src/utils/tron.ts:142
getTRC20Allowance
Get TRC20 token allowance.src/utils/tron.ts:152
checkTronTransactionReceipt
Check if a TRON transaction broadcast was successful.src/utils/tron.ts:113
Environment & Provider Utilities
getEnvConfig
Load and validate environment variables.src/utils/index.ts:62
getJsonRpcProviders
Create JSON-RPC providers for multiple EVM chains.src/utils/index.ts:5
General Utilities
delay
Delay execution for a specified number of milliseconds.Milliseconds to wait
src/utils/index.ts:153
Example:
clipHexPrefix
Remove “0x” prefix from a hex string if present.src/utils/tron.ts:4
hexToUtf8
Convert a hex string to UTF-8 (useful for error messages).src/utils/tron.ts:9