From 12e0ad7768623257d7f0580b951ebc4ee689c777 Mon Sep 17 00:00:00 2001 From: CAst Date: Fri, 3 Nov 2023 16:02:53 +0500 Subject: [PATCH] Mainnet (#31) * [mainnet] change paths and add mainnet * [mainnet] set mainnet url --- codegen.ts | 2 +- src/graphql/index.ts | 10 +++++-- .../requests/getOsTokenAPY/calculateAPY.ts | 2 +- .../getOsTokenAPY/fetchOsTokenSnapshots.ts | 4 +-- .../getOsTokenPositionShares.ts | 4 +-- src/methods/utils/getSwiseUsdPrice.ts | 8 ++--- src/methods/utils/getTransactions.ts | 6 ++-- .../vault/requests/getDaySnapshots/index.ts | 6 ++-- .../modifyDaySnapshots.spec.ts | 2 +- .../getDaySnapshots/modifyDaySnapshots.ts | 2 +- .../fetchExitQueuePositions.ts | 4 +-- .../vault/requests/getHarvestParams.ts | 4 +-- src/methods/vault/requests/getMaxWithdraw.ts | 5 ++-- .../vault/requests/getStakerActions/index.ts | 4 +-- .../getStakerActions/modifyStakerActions.ts | 2 +- .../vault/requests/getStakerActions/types.ts | 2 +- .../vault/requests/getUserRewards/index.ts | 6 ++-- .../getUserRewards/modifyUserRewards.spec.ts | 2 +- .../getUserRewards/modifyUserRewards.ts | 2 +- .../vault/requests/getValidators/index.ts | 6 ++-- .../getValidators/modifyValidators.spec.ts | 2 +- .../getValidators/modifyValidators.ts | 2 +- .../vault/requests/getValidators/types.ts | 2 +- src/methods/vault/requests/getVault/index.ts | 6 ++-- .../requests/getVault/modifyVault.spec.ts | 2 +- .../vault/requests/getVault/modifyVault.ts | 2 +- src/methods/vault/requests/getVault/types.ts | 2 +- src/utils/BigDecimal.spec.ts | 7 ----- src/utils/BigDecimal.ts | 5 ---- src/utils/configs/mainnet.ts | 30 +++++++++---------- 30 files changed, 67 insertions(+), 76 deletions(-) diff --git a/codegen.ts b/codegen.ts index 1ba0fa27..24da56de 100644 --- a/codegen.ts +++ b/codegen.ts @@ -5,7 +5,7 @@ import configs from './src/utils/configs' // For every netwrok we have same gql shema, so we can use just Mainnet here -const urls = configs[Network.Holesky].api // TODO replace on Mainnet +const urls = configs[Network.Mainnet].api // https://the-guild.dev/graphql/codegen/plugins/typescript/typescript const typesConfig = { diff --git a/src/graphql/index.ts b/src/graphql/index.ts index 7003abfc..4c7fbadc 100644 --- a/src/graphql/index.ts +++ b/src/graphql/index.ts @@ -1,2 +1,8 @@ -export * as backend from './backend' -export * as subgraph from './subgraph' +import * as backend from './backend' +import * as subgraph from './subgraph' + + +export default { + backend, + subgraph, +} diff --git a/src/methods/osToken/requests/getOsTokenAPY/calculateAPY.ts b/src/methods/osToken/requests/getOsTokenAPY/calculateAPY.ts index 74da3c98..d7092311 100644 --- a/src/methods/osToken/requests/getOsTokenAPY/calculateAPY.ts +++ b/src/methods/osToken/requests/getOsTokenAPY/calculateAPY.ts @@ -1,5 +1,5 @@ import { BigDecimal } from '../../../../utils' -import { OsTokenSnapshotsQueryPayload } from '../../../../graphql/subgraph/osToken' +import type { OsTokenSnapshotsQueryPayload } from '../../../../graphql/subgraph/osToken' type CalculateApyInput = { diff --git a/src/methods/osToken/requests/getOsTokenAPY/fetchOsTokenSnapshots.ts b/src/methods/osToken/requests/getOsTokenAPY/fetchOsTokenSnapshots.ts index c214d402..ad2852f0 100644 --- a/src/methods/osToken/requests/getOsTokenAPY/fetchOsTokenSnapshots.ts +++ b/src/methods/osToken/requests/getOsTokenAPY/fetchOsTokenSnapshots.ts @@ -1,5 +1,5 @@ import { apiUrls } from '../../../../utils' -import { subgraph } from '../../../../graphql' +import graphql from '../../../../graphql' export type FetchOsTokenSnapshotsInput = { @@ -9,7 +9,7 @@ export type FetchOsTokenSnapshotsInput = { const fetchOsTokenSnapshots = async (input: FetchOsTokenSnapshotsInput) => { const { options } = input - const data = await subgraph.osToken.fetchOsTokenSnapshotsQuery({ + const data = await graphql.subgraph.osToken.fetchOsTokenSnapshotsQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { first: 14, diff --git a/src/methods/osToken/requests/getOsTokenPosition/getOsTokenPositionShares.ts b/src/methods/osToken/requests/getOsTokenPosition/getOsTokenPositionShares.ts index 1af57aa4..392847c0 100644 --- a/src/methods/osToken/requests/getOsTokenPosition/getOsTokenPositionShares.ts +++ b/src/methods/osToken/requests/getOsTokenPosition/getOsTokenPositionShares.ts @@ -1,4 +1,4 @@ -import { subgraph } from '../../../../graphql' +import graphql from '../../../../graphql' import { apiUrls } from '../../../../utils' @@ -11,7 +11,7 @@ type GetOsTokenPositionSharesInput = { const getOsTokenPositionShares = async (values: GetOsTokenPositionSharesInput) => { const { options, vaultAddress, userAddress } = values - const result = await subgraph.osToken.fetchOsTokenPositionsQuery({ + const result = await graphql.subgraph.osToken.fetchOsTokenPositionsQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { vaultAddress, diff --git a/src/methods/utils/getSwiseUsdPrice.ts b/src/methods/utils/getSwiseUsdPrice.ts index 01e5a28c..33bee0b1 100644 --- a/src/methods/utils/getSwiseUsdPrice.ts +++ b/src/methods/utils/getSwiseUsdPrice.ts @@ -1,5 +1,5 @@ -import { backend } from '../../graphql' import { apiUrls } from '../../utils' +import graphql from '../../graphql' type GetSwiseUsdPriceInput = { @@ -9,10 +9,8 @@ type GetSwiseUsdPriceInput = { const getSwiseUsdPrice = async (input: GetSwiseUsdPriceInput) => { const { options } = input - const data = await backend.swise.fetchSwiseStatsQuery({ - // TODO remove when mainnet backend will be ready - url: 'https://testnet-api.stakewise.io/graphql', - // url: apiUrls.getBackendUrl(options), + const data = await graphql.backend.swise.fetchSwiseStatsQuery({ + url: apiUrls.getBackendUrl(options), }) return data?.swiseStats?.price || '0' diff --git a/src/methods/utils/getTransactions.ts b/src/methods/utils/getTransactions.ts index 98cc6b64..3838012f 100644 --- a/src/methods/utils/getTransactions.ts +++ b/src/methods/utils/getTransactions.ts @@ -1,6 +1,6 @@ -import { TransactionsQueryVariables } from '../../graphql/subgraph/transactions' +import type { TransactionsQueryVariables } from '../../graphql/subgraph/transactions' import { apiUrls, validateArgs } from '../../utils' -import { subgraph } from '../../graphql' +import graphql from '../../graphql' type GetTransactionsInput = { @@ -13,7 +13,7 @@ const getTransactions = async (input: GetTransactionsInput) => { validateArgs.string({ hash }) - const data = await subgraph.transactions.fetchTransactionsQuery({ + const data = await graphql.subgraph.transactions.fetchTransactionsQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { where: { diff --git a/src/methods/vault/requests/getDaySnapshots/index.ts b/src/methods/vault/requests/getDaySnapshots/index.ts index 1264c2e9..7eb6c601 100644 --- a/src/methods/vault/requests/getDaySnapshots/index.ts +++ b/src/methods/vault/requests/getDaySnapshots/index.ts @@ -1,8 +1,8 @@ -import { DaySnapshotsQueryVariables } from '../../../../graphql/subgraph/daySnapshots' +import type { DaySnapshotsQueryVariables } from '../../../../graphql/subgraph/daySnapshots' import { apiUrls, validateArgs } from '../../../../utils' import modifyDaySnapshots from './modifyDaySnapshots' import { ModifiedDaySnapshots } from './types' -import { subgraph } from '../../../../graphql' +import graphql from '../../../../graphql' type GetDaySnapshotsInput = { @@ -17,7 +17,7 @@ const getDaySnapshots = async (input: GetDaySnapshotsInput) => { validateArgs.address({ vaultAddress }) validateArgs.number({ unixStartOfDay }) - const data = await subgraph.daySnapshots.fetchDaySnapshotsQuery({ + const data = await graphql.subgraph.daySnapshots.fetchDaySnapshotsQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { where: { diff --git a/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.spec.ts b/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.spec.ts index e3e04653..a6284c53 100644 --- a/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.spec.ts +++ b/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.spec.ts @@ -1,4 +1,4 @@ -import { DaySnapshotsQueryPayload } from '../../../../graphql/subgraph/daySnapshots' +import type { DaySnapshotsQueryPayload } from '../../../../graphql/subgraph/daySnapshots' import modifyDaySnapshots, { modifyDaySnapshot } from './modifyDaySnapshots' diff --git a/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.ts b/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.ts index 8c16f690..abb67182 100644 --- a/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.ts +++ b/src/methods/vault/requests/getDaySnapshots/modifyDaySnapshots.ts @@ -1,7 +1,7 @@ import { formatEther } from 'ethers' import { ModifiedDaySnapshots } from './types' -import { DaySnapshotsQueryPayload } from '../../../../graphql/subgraph/daySnapshots' +import type { DaySnapshotsQueryPayload } from '../../../../graphql/subgraph/daySnapshots' export const modifyDaySnapshot = (daySnapshot: Omit) => { diff --git a/src/methods/vault/requests/getExitQueuePositions/fetchExitQueuePositions.ts b/src/methods/vault/requests/getExitQueuePositions/fetchExitQueuePositions.ts index 80aea810..c2c6f54e 100644 --- a/src/methods/vault/requests/getExitQueuePositions/fetchExitQueuePositions.ts +++ b/src/methods/vault/requests/getExitQueuePositions/fetchExitQueuePositions.ts @@ -1,4 +1,4 @@ -import { subgraph } from '../../../../graphql' +import graphql from '../../../../graphql' import { apiUrls } from '../../../../utils' @@ -11,7 +11,7 @@ export type FetchExitQueuePositionsInput = { const fetchExitQueuePositions = async (values: FetchExitQueuePositionsInput) => { const { options, vaultAddress, userAddress } = values - const data = await subgraph.exitQueue.fetchExitQueueQuery({ + const data = await graphql.subgraph.exitQueue.fetchExitQueueQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { vault: vaultAddress.toLowerCase(), diff --git a/src/methods/vault/requests/getHarvestParams.ts b/src/methods/vault/requests/getHarvestParams.ts index 2ef43e3f..979d8c56 100644 --- a/src/methods/vault/requests/getHarvestParams.ts +++ b/src/methods/vault/requests/getHarvestParams.ts @@ -1,5 +1,5 @@ import { apiUrls, validateArgs } from '../../../utils' -import { subgraph } from '../../../graphql' +import graphql from '../../../graphql' type GetHarvestParamsInput = { @@ -12,7 +12,7 @@ const getHarvestParams = async (values: GetHarvestParamsInput) => { validateArgs.address({ vaultAddress }) - const result = await subgraph.vault.fetchHarvestParamsQuery({ + const result = await graphql.subgraph.vault.fetchHarvestParamsQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { address: vaultAddress.toLowerCase(), diff --git a/src/methods/vault/requests/getMaxWithdraw.ts b/src/methods/vault/requests/getMaxWithdraw.ts index 46cce88e..13b3f9d6 100644 --- a/src/methods/vault/requests/getMaxWithdraw.ts +++ b/src/methods/vault/requests/getMaxWithdraw.ts @@ -35,9 +35,10 @@ const getMaxWithdraw = async (values: GetMaxWithdrawInput) => { .minus(lockedAssets) .divide(constants.blockchain.amount1) .decimals(18) + .toString() - return maxWithdrawAssets.gt(0) - ? parseEther(maxWithdrawAssets.toString()) + return Number(maxWithdrawAssets) > 0 + ? parseEther(maxWithdrawAssets) : 0n } diff --git a/src/methods/vault/requests/getStakerActions/index.ts b/src/methods/vault/requests/getStakerActions/index.ts index 9cdd87fd..e69cc3a8 100644 --- a/src/methods/vault/requests/getStakerActions/index.ts +++ b/src/methods/vault/requests/getStakerActions/index.ts @@ -2,7 +2,7 @@ import type { AllocatorActionsQueryVariables, AllocatorActionsQueryPayload } fro import { AllocatorActionType, apiUrls, validateArgs } from '../../../../utils' import modifyStakerActions from './modifyStakerActions' import { ModifiedStakerActions } from './types' -import { subgraph } from '../../../../graphql' +import graphql from '../../../../graphql' type GetStakerActionsInput = { @@ -38,7 +38,7 @@ const getStakerActions = async (input: GetStakerActionsInput) => { }) } - const data = await subgraph.allocatorActions.fetchAllocatorActionsQuery({ + const data = await graphql.subgraph.allocatorActions.fetchAllocatorActionsQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { skip, diff --git a/src/methods/vault/requests/getStakerActions/modifyStakerActions.ts b/src/methods/vault/requests/getStakerActions/modifyStakerActions.ts index c0cda7d5..f57f6a12 100644 --- a/src/methods/vault/requests/getStakerActions/modifyStakerActions.ts +++ b/src/methods/vault/requests/getStakerActions/modifyStakerActions.ts @@ -1,6 +1,6 @@ import { formatEther } from 'ethers' -import { AllocatorActionsQueryPayload } from '../../../../graphql/subgraph/allocatorActions' +import type { AllocatorActionsQueryPayload } from '../../../../graphql/subgraph/allocatorActions' import { Network, configs } from '../../../../utils' import { ModifiedStakerActions } from './types' diff --git a/src/methods/vault/requests/getStakerActions/types.ts b/src/methods/vault/requests/getStakerActions/types.ts index f248949a..88de80d2 100644 --- a/src/methods/vault/requests/getStakerActions/types.ts +++ b/src/methods/vault/requests/getStakerActions/types.ts @@ -1,4 +1,4 @@ -import { AllocatorActionsQueryPayload } from '../../../../graphql/subgraph/allocatorActions' +import type { AllocatorActionsQueryPayload } from '../../../../graphql/subgraph/allocatorActions' type AllocatorActionsPayload = Pick diff --git a/src/methods/vault/requests/getUserRewards/index.ts b/src/methods/vault/requests/getUserRewards/index.ts index c2abecaf..fe580497 100644 --- a/src/methods/vault/requests/getUserRewards/index.ts +++ b/src/methods/vault/requests/getUserRewards/index.ts @@ -1,7 +1,7 @@ -import { UserRewardsQueryVariables } from '../../../../graphql/backend/vault' +import type { UserRewardsQueryVariables } from '../../../../graphql/backend/vault' import { apiUrls, validateArgs } from '../../../../utils' import modifyUserRewards from './modifyUserRewards' -import { backend } from '../../../../graphql' +import graphql from '../../../../graphql' import { ModifyUserReward } from './types' @@ -18,7 +18,7 @@ const getUserRewards = async (input: GetUserRewardsInput) => { validateArgs.address({ vaultAddress, userAddress }) validateArgs.string({ dateFrom }) - const data = await backend.vault.fetchUserRewardsQuery({ + const data = await graphql.backend.vault.fetchUserRewardsQuery({ url: apiUrls.getBackendUrl(options), variables: { vaultAddress: vaultAddress.toLowerCase(), diff --git a/src/methods/vault/requests/getUserRewards/modifyUserRewards.spec.ts b/src/methods/vault/requests/getUserRewards/modifyUserRewards.spec.ts index fa6cbeb7..f252f1b0 100644 --- a/src/methods/vault/requests/getUserRewards/modifyUserRewards.spec.ts +++ b/src/methods/vault/requests/getUserRewards/modifyUserRewards.spec.ts @@ -1,4 +1,4 @@ -import { UserRewardsQueryPayload } from '../../../../graphql/backend/vault' +import type { UserRewardsQueryPayload } from '../../../../graphql/backend/vault' import modifyUserRewards, { modifyUserReward } from './modifyUserRewards' diff --git a/src/methods/vault/requests/getUserRewards/modifyUserRewards.ts b/src/methods/vault/requests/getUserRewards/modifyUserRewards.ts index 912a7c8d..0a2c90cb 100644 --- a/src/methods/vault/requests/getUserRewards/modifyUserRewards.ts +++ b/src/methods/vault/requests/getUserRewards/modifyUserRewards.ts @@ -1,7 +1,7 @@ import { formatEther } from 'ethers' import { ModifyUserReward } from './types' -import { UserRewardsQueryPayload } from '../../../../graphql/backend/vault' +import type { UserRewardsQueryPayload } from '../../../../graphql/backend/vault' export const modifyUserReward = (reward: Omit) => { diff --git a/src/methods/vault/requests/getValidators/index.ts b/src/methods/vault/requests/getValidators/index.ts index 0b867b95..3c0b24d3 100644 --- a/src/methods/vault/requests/getValidators/index.ts +++ b/src/methods/vault/requests/getValidators/index.ts @@ -1,8 +1,8 @@ -import { VaultValidatorsQueryVariables, VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' +import type { VaultValidatorsQueryVariables, VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' import { apiUrls, validateArgs } from '../../../../utils' import type { ModifiedValidators } from './types' import modifyValidators from './modifyValidators' -import { backend } from '../../../../graphql' +import graphql from '../../../../graphql' type GetValidatorsInput = { @@ -15,7 +15,7 @@ const getValidators = async (input: GetValidatorsInput) => { validateArgs.address({ vaultAddress }) - const data = await backend.vault.fetchVaultValidatorsQuery({ + const data = await graphql.backend.vault.fetchVaultValidatorsQuery({ url: apiUrls.getBackendUrl(options), variables: { address: vaultAddress.toLowerCase() }, modifyResult: (data: VaultValidatorsQueryPayload) => modifyValidators({ data, network: options.network }), diff --git a/src/methods/vault/requests/getValidators/modifyValidators.spec.ts b/src/methods/vault/requests/getValidators/modifyValidators.spec.ts index 8c9174f4..5a34713a 100644 --- a/src/methods/vault/requests/getValidators/modifyValidators.spec.ts +++ b/src/methods/vault/requests/getValidators/modifyValidators.spec.ts @@ -1,6 +1,6 @@ import { formatEther } from 'ethers' -import { VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' +import type { VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' import { Network, configs } from '../../../../utils' import modifyValidators from './modifyValidators' diff --git a/src/methods/vault/requests/getValidators/modifyValidators.ts b/src/methods/vault/requests/getValidators/modifyValidators.ts index 0885f542..545180f3 100644 --- a/src/methods/vault/requests/getValidators/modifyValidators.ts +++ b/src/methods/vault/requests/getValidators/modifyValidators.ts @@ -2,7 +2,7 @@ import { formatEther } from 'ethers' import type { ModifiedValidators } from './types' import { Network, configs } from '../../../../utils' -import { VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' +import type { VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' type ModifyValidatorsInput = { diff --git a/src/methods/vault/requests/getValidators/types.ts b/src/methods/vault/requests/getValidators/types.ts index 993a1ad2..78726a7b 100644 --- a/src/methods/vault/requests/getValidators/types.ts +++ b/src/methods/vault/requests/getValidators/types.ts @@ -1,4 +1,4 @@ -import { VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' +import type { VaultValidatorsQueryPayload } from '../../../../graphql/backend/vault' // earned: string, createdAt: string, publicKey: string, apy: string type AllocatorActionsPayload = Pick diff --git a/src/methods/vault/requests/getVault/index.ts b/src/methods/vault/requests/getVault/index.ts index 91693bac..7f4df537 100644 --- a/src/methods/vault/requests/getVault/index.ts +++ b/src/methods/vault/requests/getVault/index.ts @@ -1,6 +1,6 @@ -import { VaultQueryVariables, VaultQueryPayload } from '../../../../graphql/subgraph/vault' +import type { VaultQueryVariables, VaultQueryPayload } from '../../../../graphql/subgraph/vault' import { apiUrls, validateArgs } from '../../../../utils' -import { subgraph } from '../../../../graphql' +import graphql from '../../../../graphql' import { ModifiedVault } from './types' import modifyVault from './modifyVault' @@ -20,7 +20,7 @@ const getVault = async (input: GetVaultInput): Promise => { validateArgs.address({ vaultAddress }) - const data = await subgraph.vault.fetchVaultQuery({ + const data = await graphql.subgraph.vault.fetchVaultQuery({ url: apiUrls.getSubgraphqlUrl(options), variables: { address: vaultAddress.toLowerCase(), diff --git a/src/methods/vault/requests/getVault/modifyVault.spec.ts b/src/methods/vault/requests/getVault/modifyVault.spec.ts index d5318638..0f658398 100644 --- a/src/methods/vault/requests/getVault/modifyVault.spec.ts +++ b/src/methods/vault/requests/getVault/modifyVault.spec.ts @@ -2,7 +2,7 @@ import { MaxUint256 } from 'ethers' import modifyVault from './modifyVault' import { Network, configs } from '../../../../utils' -import { VaultQueryPayload } from '../../../../graphql/subgraph/vault' +import type { VaultQueryPayload } from '../../../../graphql/subgraph/vault' const network = Network.Goerli diff --git a/src/methods/vault/requests/getVault/modifyVault.ts b/src/methods/vault/requests/getVault/modifyVault.ts index a39e2fac..f6f93614 100644 --- a/src/methods/vault/requests/getVault/modifyVault.ts +++ b/src/methods/vault/requests/getVault/modifyVault.ts @@ -2,7 +2,7 @@ import { formatEther, getAddress, MaxUint256 } from 'ethers' import { ModifiedVault } from './types' import { Network, configs } from '../../../../utils' -import { VaultQueryPayload } from '../../../../graphql/subgraph/vault' +import type { VaultQueryPayload } from '../../../../graphql/subgraph/vault' type ModifyVaultInput = { diff --git a/src/methods/vault/requests/getVault/types.ts b/src/methods/vault/requests/getVault/types.ts index e23f9d85..553771cc 100644 --- a/src/methods/vault/requests/getVault/types.ts +++ b/src/methods/vault/requests/getVault/types.ts @@ -1,4 +1,4 @@ -import { VaultQueryPayload } from '../../../../graphql/subgraph/vault' +import type { VaultQueryPayload } from '../../../../graphql/subgraph/vault' export type ModifiedVault = Omit< diff --git a/src/utils/BigDecimal.spec.ts b/src/utils/BigDecimal.spec.ts index f82ab887..2f85ce67 100644 --- a/src/utils/BigDecimal.spec.ts +++ b/src/utils/BigDecimal.spec.ts @@ -48,11 +48,4 @@ describe('BigDecimal', () => { decimal.plus(25.5) expect(decimal.toString()).toBe('125.5') }) - - it('should correctly compare values with gt', () => { - const decimal = new BigDecimal(100) - expect(decimal.gt(50)).toBe(true) - expect(decimal.gt(100)).toBe(false) - expect(decimal.gt(150)).toBe(false) - }) }) diff --git a/src/utils/BigDecimal.ts b/src/utils/BigDecimal.ts index 6f0e0402..c339b8bc 100644 --- a/src/utils/BigDecimal.ts +++ b/src/utils/BigDecimal.ts @@ -60,11 +60,6 @@ class BigDecimal { return this } - // TODO remove ? - gt(value: number) { - return this.#value.gt(value) - } - toString() { return String(this.#value) } diff --git a/src/utils/configs/mainnet.ts b/src/utils/configs/mainnet.ts index 165d8674..edd3d559 100644 --- a/src/utils/configs/mainnet.ts +++ b/src/utils/configs/mainnet.ts @@ -1,12 +1,10 @@ -import { ZeroAddress } from 'ethers' - import tokens from '../constants/tokens' export default { api: { - backend: 'https://api.stakewise.io/graphql', - subgraph: 'https://graph.stakewise.io/subgraphs/name/stakewise/stakewise', + backend: 'https://mainnet-api.stakewise.io/graphql', + subgraph: 'https://mainnet-graph.stakewise.io/subgraphs/name/stakewise/stakewise', }, network: { chainId: 1, @@ -28,25 +26,25 @@ export default { addresses: { tokens: { swise: '0x48C3399719B582dD63eB5AADf12A40B4C3f52FA2', - mintToken: ZeroAddress, + mintToken: '0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38', v2RewardToken: '0x20BC832ca081b91433ff6c17f85701B6e92486c5', v2StakedToken: '0xFe2e637202056d30016725477c5da089Ab0A043A', }, base: { - keeper: ZeroAddress, - priceOracle: ZeroAddress, - vaultsRegistry: ZeroAddress, - sharedMevEscrow: ZeroAddress, - mintTokenConfig: ZeroAddress, - mintTokenController: ZeroAddress, + keeper: '0x6B5815467da09DaA7DC83Db21c9239d98Bb487b5', + priceOracle: '0x8023518b2192FB5384DAdc596765B3dD1cdFe471', + vaultsRegistry: '0x3a0008a588772446f6e656133C2D5029CC4FC20E', + sharedMevEscrow: '0x48319f97E5Da1233c21c48b80097c0FB7a20Ff86', + mintTokenConfig: '0xE8822246F8864DA92015813A39ae776087Fb1Cd5', + mintTokenController: '0x2A261e60FB14586B474C208b1B7AC6D0f5000306', multicall: '0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441', - rewardSplitterFactory: ZeroAddress, + rewardSplitterFactory: '0x90a9428b8c58cA80B28aAF46B936D42e87797449', }, factories: { - vault: ZeroAddress, - erc20Vault: ZeroAddress, - privateVault: ZeroAddress, - erc20PrivateVault: ZeroAddress, + vault: '0xDada5a8E3703B1e3EA2bAe5Ab704627eb2659fCC', + erc20Vault: '0x6DDc10eEeEBbBcF00E784bA44Fe4B038af26cB53', + privateVault: '0x170618936cd96B1eD8112eC3D3778374B38DFe5e', + erc20PrivateVault: '0xe84183EfFbcc76D022Cccc31b95EAa332bB5Bb11', }, uniswap: { positionManager: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88',