Fallback Addresses


For Cosmos routes where either the source or destination chains are not of coinType 118, the SDK necessitates an additional argument. This argument is fallbackAddresses, which is an array of objects containing an address and its associated coin type.


fallbackAddresses: [{ address: string, coinType: number}]


fallbackAddresses: [
        "address": "cosmos1....",
        "coinType": 118


If the source or to chain is of coinType 118, Squid will use that to infer the addresses for any intermediary chains.


When Squid routes between chains, intermediary chains might exist between the source and destination that are of different coinTypes. For instance, if the Source chain is Avalanche and the destination chain is Secret, swaps might occur on an intermediary chain like Osmosis. Since it's not feasible to deduce the user's address on Osmosis due to the distinct coinTypes of each chain, a fallback address on Osmosis is necessary in case of a swap failure.

Currently, all the "hop" chains that Squid utilizes are of coinType 118. As a result, for certain routes, Squid mandates the caller to provide a sample address of type 118, such as Cosmoshub. While many routes don't necessitate this, if a route does require it, Squid will return an error.


The Squid widget currently passes in the users connected cosmoshub address into all requested Cosmos routes. It doesn't matter what the middle hop chain is, this correct address can be inffered as long as its a coinType 118 as cosmoshub addreses are

Last updated