mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 14:42:38 +03:00
make PlatformFees fields optional. temporary solution
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.19.89-rc11",
|
||||
"version": "0.19.89-rc12",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.19.89-rc11",
|
||||
"version": "0.19.89-rc12",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.19.89-rc11",
|
||||
"version": "0.19.89-rc12",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -12,3 +12,4 @@ export * from './gasLimits.js';
|
||||
export * from './timings.js';
|
||||
|
||||
export const SERVICE_TOKEN = 'ORN';
|
||||
export const INITIAL_VEORN_ADJUSTMENT_FACTOR = 5;
|
||||
|
||||
@@ -61,8 +61,8 @@ type AtomicSwapHistoryTargetQuery = AtomicSwapHistoryBaseQuery & {
|
||||
}
|
||||
|
||||
type PlatformFees = {
|
||||
assetIn: string
|
||||
assetOut: string
|
||||
assetIn?: string // TODO: return types from main branch
|
||||
assetOut?: string
|
||||
walletAddress?: string | undefined
|
||||
fromWidget?: string | undefined
|
||||
}
|
||||
@@ -247,8 +247,13 @@ class BlockchainService {
|
||||
) => {
|
||||
const url = new URL(`${this.apiUrl}/api/platform-fees`);
|
||||
|
||||
url.searchParams.append('assetIn', assetIn);
|
||||
url.searchParams.append('assetOut', assetOut);
|
||||
if (assetIn !== undefined) { // TODO: make same as in main branch
|
||||
url.searchParams.append('assetIn', assetIn);
|
||||
}
|
||||
|
||||
if (assetOut !== undefined) {
|
||||
url.searchParams.append('assetOut', assetOut);
|
||||
}
|
||||
|
||||
if (walletAddress !== undefined) {
|
||||
url.searchParams.append('walletAddress', walletAddress);
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from './schemas/index.js';
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { DAY, LOCK_START_TIME, YEAR } from '../../constants/index.js';
|
||||
import { DAY, INITIAL_VEORN_ADJUSTMENT_FACTOR, LOCK_START_TIME, YEAR } from '../../constants/index.js';
|
||||
|
||||
type BasePayload = {
|
||||
chainId: number
|
||||
@@ -109,7 +109,7 @@ class IntegratorService {
|
||||
})
|
||||
}
|
||||
|
||||
getAmountAtCurrent = (amount: number) => {
|
||||
getAmountAtCurrent = async (amount: number) => {
|
||||
const timestamp = Date.now() / 1000;
|
||||
|
||||
// sqrt
|
||||
@@ -191,7 +191,7 @@ class IntegratorService {
|
||||
}
|
||||
|
||||
// sqrt
|
||||
return BigNumber(amountToken).multipliedBy(BigNumber(deltaDays).sqrt()).dividedBy(5);
|
||||
return BigNumber(amountToken).multipliedBy(BigNumber(deltaDays).sqrt()).dividedBy(INITIAL_VEORN_ADJUSTMENT_FACTOR);
|
||||
}
|
||||
|
||||
private readonly getVotingInfo = (userAddress: number) => {
|
||||
|
||||
Reference in New Issue
Block a user