Skip to content

getTokenOut

The getTokenOut method retrieves the output token address from a route.

Signature

getTokenOut(): string

Returns

Returns the address of the output token. For native SEI token swaps, returns the wrapped SEI (WSEI) address.

Example Usage

const symphony = new Symphony();
 
// Get a route for USDC -> SEI swap
const route = await symphony.getRoute(
  "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
  "0x0", // SEI
  "1.0"
);
 
// Get output token address
const tokenOut = route.getTokenOut();
console.log(tokenOut); // "0xe30fedd158a2e3b13e9badaeabafc5516e95e8c7" (WSEI)

Notes

  • For native SEI token swaps, returns the WSEI (Wrapped SEI) address
  • The token address is always returned in lowercase format
  • Use getRouteDetails if you need more token information like decimals or symbol

Error Handling

The method will return undefined if:

  • The route is invalid or empty
  • The route array structure is incorrect