Estimating Swaps
Endpoint
POST https://api.bitbadges.io/api/v0/api/{version}/swaps/estimateexport interface iEstimateSwapPayload {
/** The token in to swap. Format: "amount:X,denom:Y" */
tokenIn: string;
/** Optional chain ID for the token in. Defaults to "bitbadges-1" if not provided. */
tokenInChainId?: string;
/** The token out denom to swap to. */
tokenOutDenom: string;
/** Optional chain ID for the token out. Defaults to "bitbadges-1" if not provided. */
tokenOutChainId?: string;
/**
* Mapping of chain IDs to addresses.
* Only supports "bitbadges-1" (bech32 bb prefixed address for Cosmos-based chains and "1" (EVM-based chains with a standard 0x address)
*
* We will generate any other chain addresses from these addresses.
*/
chainIdsToAddresses: Record<string, string>;
/**
* Optional mapping of chain IDs to affiliate fee recipients.
* Structure: { [chainId]: { affiliates: Array<{ address: string; basis_points_fee: string }> } }
*/
chainIdsToAffiliates?: Record<string, { affiliates: Array<{ address: string; basis_points_fee: string }> }>;
/** Slippage tolerance as a percentage (0-100). Can be a string or number. */
slippageTolerancePercent: string | number;
/** Forcefully recheck compliance and avoid cache (5 minutes) */
forcefulRecheckCompliance?: boolean;
}Skip Go Compatibility
Example
Last updated