Class: WardenPayloadCompressor
A class for calldata compression to be used with WardenSwap on L2 chains
• new WardenPayloadCompressor(networkName, provider, multicallOptions?)
Create new instance of WardenPayloadCompressor
Parameters
"bsc" | "arbitrum" | "polygon" | "ethereum" | "avalanche" | "optimism"
Chain name (supported by WardenSwap)
▸ compress(src, dest, amountIn, minDestAmount, partnerId, metaData, swapAddress, receiver, paths, volumes): Promise<string>
Compress calldata for L2 chains
Parameters
Minimum amount of destination token required
PathResult | PathResult[]
Path result(s) gathered from getQuote
Splitting ratio of source token amount range from 1-100
Returns
Promise<string>
Serialized data to be used with swap functions with compression feature
▸ encodeSwapData(paths): string
Encode swap data for L1 chains
Parameters
PathResult | PathResult[]
Path result(s) gathered from getQuote
Returns
string
A hexadecimal string representing encoded swap data
encodeSwapDataL2
▸ encodeSwapDataL2(paths, volumes, addressIdxMap?): Promise<string>
Compress swap data for L2 chains
Parameters
PathResult | PathResult[]
Path result(s) gathered from getQuote
Splitting ratio of source token amount range from 1-100
Address-index map gathered from ArbAddressTable contract
Returns
Promise<string>
A hexadecimal string representing compressed swap data