mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-25 07:07:39 +03:00
added fee payment to matcher if dst.Token === feeToken
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import { SwapExecutor__factory } from "@orionprotocol/contracts/lib/ethers-v6/index.js"
|
||||
import type { BigNumberish } from "ethers"
|
||||
import type { BigNumberish, AddressLike } from "ethers"
|
||||
import { type CallParams, addCallParams } from "./utils.js"
|
||||
import type { AddressLike } from "ethers"
|
||||
|
||||
export async function generateTransferCall(
|
||||
export function generateTransferCall(
|
||||
token: AddressLike,
|
||||
target: AddressLike,
|
||||
amount: BigNumberish,
|
||||
@@ -20,7 +19,7 @@ export async function generateTransferCall(
|
||||
return addCallParams(calldata, callParams)
|
||||
}
|
||||
|
||||
export async function generateApproveCall(
|
||||
export function generateApproveCall(
|
||||
token: AddressLike,
|
||||
target: AddressLike,
|
||||
amount: BigNumberish,
|
||||
|
||||
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)
|
||||
}
|
||||
@@ -36,7 +36,7 @@ export async function generateUni2Calls(
|
||||
return calls
|
||||
}
|
||||
|
||||
export async function generateUni2Call(
|
||||
export function generateUni2Call(
|
||||
pool: string,
|
||||
assetIn: string,
|
||||
assetOut: string,
|
||||
|
||||
Reference in New Issue
Block a user