Cosmos custom calls

Execute any custom calls at the end of Squid Route

There are mainly two types of calls in cosmos - native call or CosmWasm contract call. Squid supports both cases.

Custom Cosmos contract call structure

export type CustomCosmosContractCall = {
  contract?: string; // must be set for wasm calls
  msg: object; // properly built object with a message call
}

Building a valid contract call

Let's assume we want to stake our OSMO tokens after we completed our swaps. Staking on Osmosis can be done in 2 ways - via native message or via calling a smart contract.

Example of stargate message


{
    "msg": {
        "stake": {
            "denom": "uosmo"
        }
    }
}

Example of wasm hook message

Example of Mars Red Bank deposit call on Osmosis

Not found

Last updated