Skip to content

getTokenIn

The getTokenIn method retrieves the input token address from a route.

Signature

getTokenIn(): string

Returns

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

Example Usage

const symphony = new Symphony();
 
// Get a route for SEI -> USDC swap
const route = await symphony.getRoute(
  "0x0", // SEI
  "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
  "1.0"
);
 
// Get input token address
const tokenIn = route.getTokenIn();
console.log(tokenIn); // "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