mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-16 16:21:32 +03:00
Merge remote-tracking branch 'origin/main' into feat/ethers-v6
# Conflicts: # package-lock.json # package.json
This commit is contained in:
@@ -45,8 +45,8 @@ export default async function generateSwapCalldata({
|
||||
const curveRegistryAddress = safeGet(unit.contracts, 'curveRegistry')
|
||||
const { assetToAddress, swapExecutorContractAddress, exchangeContractAddress } = await simpleFetch(unit.blockchainService.getInfo)();
|
||||
let path = SafeArray.from(path_).map((swapInfo) => {
|
||||
swapInfo.assetIn = safeGet(assetToAddress, swapInfo.assetIn);
|
||||
swapInfo.assetOut = safeGet(assetToAddress, swapInfo.assetOut);
|
||||
swapInfo.assetIn = assetToAddress[swapInfo.assetIn] ?? swapInfo.assetIn.toLowerCase();
|
||||
swapInfo.assetOut = assetToAddress[swapInfo.assetOut] ?? swapInfo.assetOut.toLowerCase();
|
||||
return swapInfo;
|
||||
})
|
||||
const factory = path.first().factory
|
||||
|
||||
@@ -59,6 +59,13 @@ type AtomicSwapHistoryTargetQuery = AtomicSwapHistoryBaseQuery & {
|
||||
expiredRedeem?: 0 | 1
|
||||
state?: 'REDEEMED' | 'BEFORE-REDEEM'
|
||||
}
|
||||
|
||||
type PlatformFees = {
|
||||
assetIn: string
|
||||
assetOut: string
|
||||
walletAddress?: string | undefined
|
||||
fromWidget?: string | undefined
|
||||
}
|
||||
class BlockchainService {
|
||||
private readonly apiUrl: string;
|
||||
|
||||
@@ -231,23 +238,17 @@ class BlockchainService {
|
||||
{ headers: this.basicAuthHeaders }
|
||||
);
|
||||
|
||||
getPlatformFees = (
|
||||
{ assetIn, assetOut, walletAddress, fromWidget }: {
|
||||
assetIn?: string | undefined,
|
||||
assetOut?: string | undefined,
|
||||
walletAddress?: string | undefined,
|
||||
fromWidget?: string | undefined
|
||||
}
|
||||
getPlatformFees = ({
|
||||
assetIn,
|
||||
assetOut,
|
||||
walletAddress,
|
||||
fromWidget
|
||||
}: PlatformFees
|
||||
) => {
|
||||
const url = new URL(`${this.apiUrl}/api/platform-fees`);
|
||||
|
||||
if (assetIn !== undefined) {
|
||||
url.searchParams.append('assetIn', assetIn);
|
||||
}
|
||||
|
||||
if (assetOut !== undefined) {
|
||||
url.searchParams.append('assetOut', assetOut);
|
||||
}
|
||||
url.searchParams.append('assetIn', assetIn);
|
||||
url.searchParams.append('assetOut', assetOut);
|
||||
|
||||
if (walletAddress !== undefined) {
|
||||
url.searchParams.append('walletAddress', walletAddress);
|
||||
|
||||
Reference in New Issue
Block a user