mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-14 06:02:36 +03:00
convert addresslike to string
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.34-rc-2",
|
||||
"version": "0.20.34-rc-3",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -107,8 +107,8 @@ export async function generateSwapCalldata({
|
||||
initiatorAddress,
|
||||
receiverAddress,
|
||||
path: arrayLikePath,
|
||||
matcher = ZeroAddress,
|
||||
feeToken = ZeroAddress,
|
||||
matcher: matcherAddressLike = ZeroAddress,
|
||||
feeToken: feeTokenAddressLike = ZeroAddress,
|
||||
fee = 0,
|
||||
exchangeContractAddress,
|
||||
wethAddress: wethAddressLike,
|
||||
@@ -123,6 +123,8 @@ export async function generateSwapCalldata({
|
||||
const wethAddress = await addressLikeToString(wethAddressLike);
|
||||
const curveRegistryAddress = await addressLikeToString(curveRegistryAddressLike);
|
||||
const swapExecutorContractAddress = await addressLikeToString(swapExecutorContractAddressLike);
|
||||
const feeToken = await addressLikeToString(feeTokenAddressLike);
|
||||
const matcher = await addressLikeToString(matcherAddressLike);
|
||||
let path = SafeArray.from(arrayLikePath);
|
||||
|
||||
const { assetIn: srcToken } = path.first();
|
||||
@@ -333,13 +335,14 @@ async function processMultiFactorySwaps(
|
||||
}
|
||||
|
||||
async function payFeeToMatcher(
|
||||
matcher: AddressLike,
|
||||
feeToken: AddressLike,
|
||||
matcher: string,
|
||||
feeToken: string,
|
||||
feeAmount: BigNumberish,
|
||||
calls: BytesLike[],
|
||||
swapDescription: LibValidator.SwapDescriptionStruct,
|
||||
) {
|
||||
if (feeAmount !== 0n && feeToken === swapDescription.dstToken) {
|
||||
|
||||
if (BigInt(feeAmount) !== 0n && feeToken === swapDescription.dstToken) {
|
||||
const feePaymentCall = generateFeePaymentCall(matcher, feeToken, feeAmount)
|
||||
calls.push(feePaymentCall)
|
||||
}
|
||||
|
||||
@@ -5,5 +5,5 @@ export async function addressLikeToString(address: AddressLike): Promise<string>
|
||||
if (typeof address !== 'string') {
|
||||
address = await address.getAddress()
|
||||
}
|
||||
return address
|
||||
return address.toLowerCase()
|
||||
}
|
||||
Reference in New Issue
Block a user