Skip to content

Commit

Permalink
feat: update 0x api to reflect new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalielhere committed Mar 11, 2025
1 parent 048f6f5 commit ab3bc1d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/swap/src/providers/zerox/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,19 @@ class ZeroX extends ProviderClass {
// zerox doesnt allow different to address
return Promise.resolve(null);
const feeConfig = FEE_CONFIGS[this.name][meta.walletIdentifier];
const bpsFee = parseFloat((feeConfig.fee * 100).toFixed(4)) * 100;
const feeContract = options.toToken.address
const params = new URLSearchParams({
sellToken: options.fromToken.address,
buyToken: options.toToken.address,
sellAmount: options.amount.toString(),
swapFeeBps: bpsFee.toString(),
swapFeeToken: feeContract,
swapFeeRecipient: feeConfig ? feeConfig.referrer : "",
taker: options.fromAddress,
slippagePercentage: (
parseFloat(meta.slippage ? meta.slippage : DEFAULT_SLIPPAGE) / 100
).toString(),
buyTokenPercentageFee: feeConfig ? feeConfig.fee.toString() : "0",
feeRecipient: feeConfig ? feeConfig.referrer : "",
skipValidation: "true",
enableSlippageProtection: "false",
affiliateAddress: feeConfig ? feeConfig.referrer : "",
Expand Down

0 comments on commit ab3bc1d

Please sign in to comment.