added fee payment to matcher if dst.Token === feeToken

This commit is contained in:
Steam Deck User
2023-12-15 17:55:44 +04:00
parent b847a173bb
commit 826b3b508c
6 changed files with 90 additions and 28 deletions

View File

@@ -0,0 +1,21 @@
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
import type { BigNumberish, AddressLike } from "ethers"
import { type CallParams, addCallParams } from "./utils.js"
export function generateFeePaymentCall(
matcher: AddressLike,
token: AddressLike,
amount: BigNumberish,
callParams?: CallParams
) {
const executorInterface = SwapExecutor__factory.createInterface()
const calldata = executorInterface.encodeFunctionData('payFeeToMatcher', [
matcher,
token,
amount
])
return addCallParams(calldata, callParams)
}