mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 22:52:36 +03:00
OP-4534: Integrator pools (#188)
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.6",
|
||||
"version": "0.20.8",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.6",
|
||||
"version": "0.20.8",
|
||||
"hasInstallScript": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@orionprotocol/sdk",
|
||||
"version": "0.20.7",
|
||||
"version": "0.20.8",
|
||||
"description": "Orion Protocol SDK",
|
||||
"main": "./lib/index.cjs",
|
||||
"module": "./lib/index.js",
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
} from './schemas/index.js';
|
||||
import type redeemOrderSchema from '../Aggregator/schemas/redeemOrderSchema.js';
|
||||
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
|
||||
import { makePartial } from '../../utils/index.js';
|
||||
import { makePartial } from '../../utils';
|
||||
import type { networkCodes } from '../../constants/index.js';
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import type { BasicAuthCredentials } from '../../types.js';
|
||||
@@ -61,8 +61,8 @@ type AtomicSwapHistoryTargetQuery = AtomicSwapHistoryBaseQuery & {
|
||||
}
|
||||
|
||||
type PlatformFees = {
|
||||
assetIn?: string // TODO: return types from main branch
|
||||
assetOut?: string
|
||||
assetIn: string
|
||||
assetOut: string
|
||||
walletAddress?: string | undefined
|
||||
fromWidget?: string | undefined
|
||||
}
|
||||
@@ -247,13 +247,8 @@ class BlockchainService {
|
||||
) => {
|
||||
const url = new URL(`${this.apiUrl}/api/platform-fees`);
|
||||
|
||||
if (assetIn !== undefined) { // TODO: make same as in main branch
|
||||
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);
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
export const AVAILABLE_POOL_FEE = ['0.01', '0.05', '0.3', '1'] as const;
|
||||
export const INITIAL_VEORN_ADJUSTMENT_FACTOR = 5;
|
||||
export const LOCK_START_TIME = 1690848000;// Aug 01 2023 00:00:00 UTC
|
||||
|
||||
@@ -6,12 +6,12 @@ import {
|
||||
listPoolResponseSchema,
|
||||
testIncrementorSchema,
|
||||
veORNInfoResponseSchema,
|
||||
votingInfoResponseSchema,
|
||||
} from './schemas/index.js';
|
||||
votingInfoResponseSchema
|
||||
} from './schemas';
|
||||
import { fetchWithValidation } from 'simple-typed-fetch';
|
||||
import { BigNumber } from 'bignumber.js';
|
||||
import { DAY, WEEK_DAYS, YEAR } from '../../constants/index.js';
|
||||
import { LOCK_START_TIME } from './constants.js';
|
||||
import { DAY, WEEK_DAYS, YEAR } from '../../constants';
|
||||
import { LOCK_START_TIME } from './constants';
|
||||
|
||||
type BasePayload = {
|
||||
chainId: number
|
||||
@@ -166,7 +166,7 @@ class IntegratorService {
|
||||
readonly getPoolInfo = (
|
||||
token0: string,
|
||||
token1: string,
|
||||
poolAddress: string
|
||||
poolAddress?: string
|
||||
) => {
|
||||
return fetchWithValidation(this.apiUrl, getPoolResponseSchema, {
|
||||
method: 'POST',
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { z } from 'zod';
|
||||
import { evmAddressSchema } from './util-schemas.js';
|
||||
import { AVAILABLE_POOL_FEE } from '../constants.js';
|
||||
import basicPoolInfo from './basic-pool-info-schema.js';
|
||||
import infoSchema from './info-schema.js';
|
||||
|
||||
@@ -13,7 +12,7 @@ const getPoolResponseSchema = z.object({
|
||||
|
||||
totalLiquidity: z.number().nonnegative(),
|
||||
WETH9: evmAddressSchema,
|
||||
pools: z.record(z.enum(AVAILABLE_POOL_FEE), basicPoolInfo.nullable()),
|
||||
pools: z.record(z.number(), basicPoolInfo.nullable()),
|
||||
}),
|
||||
info: infoSchema,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user