diff --git a/.changeset/silver-pears-mate.md b/.changeset/silver-pears-mate.md new file mode 100644 index 000000000..7a4938cd2 --- /dev/null +++ b/.changeset/silver-pears-mate.md @@ -0,0 +1,5 @@ +--- +'@xchainjs/xchain-aggregator': patch +--- + +Affiliate bug fix in `doSwap` function diff --git a/packages/xchain-aggregator/src/protocols/mayachain/mayachainProtocol.ts b/packages/xchain-aggregator/src/protocols/mayachain/mayachainProtocol.ts index 2ca980504..0adfcb24b 100644 --- a/packages/xchain-aggregator/src/protocols/mayachain/mayachainProtocol.ts +++ b/packages/xchain-aggregator/src/protocols/mayachain/mayachainProtocol.ts @@ -80,7 +80,11 @@ export class MayachainProtocol implements IProtocol { * @returns {TxSubmitted} Transaction hash and URL of the swap */ public async doSwap(params: QuoteSwapParams): Promise { - return this.mayachainAmm.doSwap(params) + return this.mayachainAmm.doSwap({ + ...params, + affiliateBps: this.configuration?.affiliateBps, + affiliateAddress: this.configuration?.affiliateAddress, + }) } /** diff --git a/packages/xchain-aggregator/src/protocols/thorchain/thorchainProtocol.ts b/packages/xchain-aggregator/src/protocols/thorchain/thorchainProtocol.ts index 6d8d9f448..13763ab69 100644 --- a/packages/xchain-aggregator/src/protocols/thorchain/thorchainProtocol.ts +++ b/packages/xchain-aggregator/src/protocols/thorchain/thorchainProtocol.ts @@ -81,7 +81,11 @@ export class ThorchainProtocol implements IProtocol { * @returns {TxSubmitted} Transaction hash and URL of the swap */ public async doSwap(params: QuoteSwapParams): Promise { - return this.thorchainAmm.doSwap(params) + return this.thorchainAmm.doSwap({ + ...params, + affiliateBps: this.configuration?.affiliateBps, + affiliateAddress: this.configuration?.affiliateAddress, + }) } /**x