Skip to main content

What is fromAddress in a routing API?

fromAddress is the source wallet or account that will sign, and the address the route or bundle is built for. It is not always the same as receiver.

J
Written by Javier Diaz

fromAddress is the source wallet or account that will sign the returned transaction, and the address the route or bundle is built for.

Definition

A routing API needs to know which account is spending and submitting. That account may differ from the address that should receive the final output.

How it works

  • Set fromAddress to the account that will submit tx.

  • The selected routing strategy uses that address as the EOA, the smart-wallet context, or the account associated with an Enso smart-account client.

  • receiver can be a different address when the output should be delivered elsewhere.

  • spender identifies the account supplying inputs when the strategy supports it, and is not interchangeable with receiver.

How Enso does this

fromAddress is a required field on Route and Bundle requests. On Bundle it is a query parameter for REST, or part of the first argument to getBundleData in the SDK. See DeFi and Swap Routing and Routing Strategies. Always submit the returned tx from that account, unchanged.

FAQ

Can fromAddress and receiver be different?

Yes. fromAddress is the signer and source account. receiver is who should receive the final output.

Does fromAddress have to hold the tokens when I quote?

The API can still return a route if the wallet is empty; execution fails if funds are not available at send time.

Related articles

  • What is the difference between receiver and refundReceiver?

  • How do I set the receiver of a route?

  • What is a routing strategy?

  • What if the user doesn’t have sufficient funds?

  • How do I submit Enso transaction data from my app?

Sources

Did this answer your question?