Contract call types

Squid supports multiple call types, which allow you to make contract calls using the exact amount of tokens received from swaps executed via Squid, or from previous calls which the integrator has made, like staking tokens and receiving an LP token.

These call types can be set using the callType parameter.

callType can have the following values:

- target address of the smart contract to be called. - value amount of native coin, in most scenarios should be "0" . - callData contract call encoded data. - estimatedGas amount of gas of the call. - payload.tokenAddress address of the token to get the balance. - payload.inputPos position of the amount argument in the contract call to set the balance dynamically.

enum SquidCallType {
  DEFAULT = 0,
  FULL_TOKEN_BALANCE = 1,
  FULL_NATIVE_BALANCE = 2,
  COLLECT_TOKEN_BALANCE = 3,
}

type ContractCall = {
  callType: SquidCallType;
  target: string;
  value?: string;
  callData: string;
  payload?: {
    tokenAddress: string;
    inputPos: number;
  };
  estimatedGas: string;
}

Last updated