mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
added fee payment to matcher if dst.Token === feeToken
This commit is contained in:
21
src/Unit/Exchange/callGenerators/feePayment.ts
Normal file
21
src/Unit/Exchange/callGenerators/feePayment.ts
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user